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...

#!c:/perl/bin/perl.exe # Command line WebDAV client use strict; use warnings; use Getopt::Long; use HTTP::DAV; my ( $source, $destination, $username, $password ); GetOptions ('source=s' => \$source, 'destination=s' => \$destination, 'username=s' => \$username, 'password=s' => \$password, ); unless ( $source && $destination && $username && $password ) { print "Error: Missing parameters\n\n"; get_help(); exit(1); } my $dav = new HTTP::DAV; $dav->credentials( -user =>$username, -pass =>$password, -url =>$destination, ); $dav->open( -url=>$destination ) or die("Couldn't open $destination: " .$dav->message . "\n"); if ( $dav->put( -local => "$source", -url => $destination ) ) { print "\nSuccessfully uploaded $source to $destination\n"; } else { print "Put failed: " . $dav->message . "\n"; } sub get_help { print <<"HEREDOC"; Perl WebDAV client. Usage: webdav.exe --source [path to source file(s), accepts regex] --destinat +ion [url to WebDAV server] --username [your username, prefix with domain. e.g. domain\usernam +e] --password [your password] HEREDOC }

In reply to Re: upload files from UX FileSystem to a Sharepoint Location by puploki
in thread upload files from UX FileSystem to a Sharepoint Location by MH

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.