Upload files from Linux to SharePoint on-premise

When there is a need to automate the upload of files from Linux to SharePoint on-premise, we can use the  curl command tool. Let’s take a look at an example.

curl --ntlm username:password --upload-file test.html https://sharepoint.com/files/test.html

On this command, we use the following parameters:

This parameter is used to pass the domain credentials for the user in the format of username:password. 

The username should not include the domain name.
Use this parameter to indicate that we need to upload a file to a server location

Server url
This is the server URL.  Notice how we also indicate the folder and file name.

If you are having problems, add this parameter to see output and error messages.

Use this command to automate the process to upload your files to SharePoint.

Originally published by ozkary.com