http://qs1969.pair.com?node_id=1049490

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

I have a requirement to programmatically upload a flat file (xyz.txt) that gets generated everyday on a Linux server to Sharepoint.

Please advise how it can be done using Perl on Linux. I could then schedule this script to run as a job everyday at a particular time to automate this process.

Your advise would be much appreciated. Any example code extract would be even more helpful.

thanks

  • Comment on How to upload file from Linux to Sharepoint using Perl

Replies are listed 'Best First'.
Re: How to upload file from Linux to Sharepoint using Perl
by frozenwithjoy (Priest) on Aug 15, 2013 at 01:13 UTC
    Seems like it would be easier to just create a cron job to schedule a daily curl call.

    To edit your cron jobs, use: crontab -e. Adding something like the following should upload your file every morning at 5AM:

    00 5 * * * /usr/bin/curl --ntlm -u <your Active-Directory-Domain>/<you +r-domain-username> -T /path/to/xyz.txt http://sharepoint.url.com/doc/ +library/dir/
      curl --ntlm -u domain/userid:passwd -T <file> "sharepoint URL"
      simpe one curl --ntlm -u domain/userid:passwd -T <file> "sharepoint URL"
Re: How to upload file from Linux to Sharepoint using Perl
by ww (Archbishop) on Aug 15, 2013 at 01:26 UTC

    Seems as though the "requirement" was probably set by a teacher (and is homework) or by a boss (and is $work).

    If the former, you won't learn much if we supply the code... and, generally, our charter is to help you learn; not to be code-a-matic.

    If the latter, the boss should hire a programmer - - i.e. pay for the $work.

      Seems ...

      So ww do you know which modules can be used?

        "...you know which modules can be used?"

        WWW::Curl which sucks - IMHO. I guess therefore the many hints to call curl directly...

        Regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

        simpe one curl --ntlm -u domain/userid:passwd -T <file> "sharepoint URL"
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: How to upload file from Linux to Sharepoint using Perl (protocols)
by Anonymous Monk on Aug 15, 2013 at 01:45 UTC
Re: How to upload file from Linux to Sharepoint using Perl
by sundialsvc4 (Abbot) on Aug 15, 2013 at 13:02 UTC

      Holy moly, you are back. And i thought you retired!

      «The Crux of the Biscuit is the Apostrophe»

        Holy moly, you are back. And i thought you retired!

        Look at the dates , always look at the dates :)

Re: How to upload file from Linux to Sharepoint using Perl
by Anonymous Monk on May 25, 2021 at 13:52 UTC
    I am facing the same challenge but script is throwing error . Is it resolved for you?
    > put /sites/WalmartUSAssociateAnalytics/Exceptions%20File/sample.csv +HTTP/1.1 > Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +XXXXXX== > User-Agent: curl/7.29.0 > Host: teams.wal-mart.com > Accept: */* > Content-Length: 13 > Expect: 100-continue > < HTTP/1.1 100 Continue * We are completely uploaded and fine < HTTP/1.1 403 FORBIDDEN < Content-Length: 13