How to send file to Sharepoint from Linux creating non existend directories

10,882

As the name (CLIENT URL) suggests, you will not be able to create new directories on remote SERVERS involving http/https while uploading files.

For downloads involving http/https server, --create-dirs option is applicable only on local machines to create new directories (for instance, when you are downloading a content on to your local linux machine).

However, while using ftp/sftp to a server, you will be able to create new directories on the remote server.

Share:
10,882
WojtusJ
Author by

WojtusJ

Updated on July 14, 2022

Comments

  • WojtusJ
    WojtusJ almost 2 years

    I have a problem while sending file from linux to SharePoint. Everything is fine if I am uploading to existing directory, I use this method:

    curl --ntlm --user username:password --upload-file myfile.xls https://sharepointserver.com/sites/mysite/myfile.xls
    

    Unfortunately problem arises when I point the target to non existing directory, like:

    curl --ntlm --user username:password --upload-file myfile.xls https://sharepointserver.com/sites/mysite/nonexist/myfile.xls
    

    I would like it to create all necessary directorie on the path. I've tried to use "--create-dirs" CURL option, but it doesn't work.

    Any ideas how to achieve the goal? It doesn't have to be CURL actually, i can use different method available on linux.