MH has asked for the wisdom of the Perl Monks concerning the following question:

Revered Monks, My goal is to pull relevant data from out Sybase Databases and upload the Mgmnt Reports daily on a Sharepoint Portal Location. I need to upload DataFiles(which serve as Mgmnt Reports) on a Unix FileSystem to a Sharepoint Location in MS Excel Format. I have written a UnixShell Script that connects to a Sybase database on Unix and a Sybase stored procedure pulls in the relevant data and the result set is stored on a Unix FileSystem in the form of a .csv file. I am looking for a Perl Script / Perl module which can pick this file and upload it on a Sharepoint portal location. Is HTTP::WebDav meant for this? I do not have clarity on this. Kind Regards, ~Mihir
  • Comment on upload files from UX FileSystem to a Sharepoint Location

Replies are listed 'Best First'.
Re: upload files from UX FileSystem to a Sharepoint Location
by puploki (Hermit) on Apr 30, 2007 at 15:30 UTC

    I do pretty much exactly this (although I'm taking a file from Crystal Reporting and posting it to a Sharepoint document library). WebDAV is indeed the way to go - I originally just wrote this code to compile up with PAR so I could give people a command line tool they could use in their scripting, hence it's a little over engineered.

    It's worth pointing out that in Sharepoint 2007 you can also email enable document libraries, so you can simply email an attachment and it just appears in the right place...

      Thanks for this piece of code puploki! Well Can you give an example usage of your code.
      Should I specify,teh path of my file(/ms/dev/Data.csv) to be uploaded in the $source variable?
      Regards, ~Mihir
      using this approach, I get a 401.2 error - "You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept."
      Hello - today when I try this code, the error I get is: The keep_alive option must be enabled for NTLM authentication to work. NTLM authentication aborted.
Re: upload files from UX FileSystem to a Sharepoint Location
by jettero (Monsignor) on Apr 30, 2007 at 15:13 UTC

    To convert to MS Excel (reading the .csv with Text::CSV), I'd probably choose Spreadsheet::WriteExcel. I'm not in any way familiar with HTTP::Webdav, but it seems to be a really comprehensive solution for something.

    -Paul