I have a Perl app that runs some perforce operations, in the end I would like it to upload the results to SharePoint website.
- What is the simplest Perl script that can accomplish a task of adding a document to SharePoint?
The script would need to run on Solaris and use as few as possible external libraries as possible (definitely pure classic Perl) getting anything additional installed on these unix boxes is a pain and would have to be done by remote team.
If this can uploading document can easily be done with wget, that would be of interest too. Anyways, I am looking for 1 or a couple liner that's easy to understand.
UPDATES based on comments:
- Perl Mechanize sounded like a good idea, but for some reason I am not able to authenticate, Error GETing
http://sharepoint Unauthorized ....
I had this:
my $m = WWW::Mechanize->new();
$m->credentials($user => $pass);
$m->get($url);
But mechanize won't authenticate against sharepoint for some reason.
- Does anybody have a link or a sample on how to use sharepoint webdav from unix via perl?
I installed and tried to open my typical sharepoint site via "dave" webdav browser, but I get ** Unauthorized. **
error.
- How to solve it with the webdav approach with perl on unix?
To make NTLM authentication work in WWW::Mechanize you need to use this format
Can you use the Webdav interface? Each SharePoint list has a webdav folder associated with it.
Just found an easy way on windows from perlmonks forum:
just adding as answer to myself, now I got to figure out how to script this from Perl and whether there is way to do the same from script running on unix.
You can connect to SharePoint (or any website) using curl, which is able to authenticate and perform negotiation with Kerberos/NTLM:
This sounds like a job for WWW::Mechanize. It has excellent support for dealing with forms.