Forum Discussion

RajKrisBWDG's avatar
RajKrisBWDG
Copper Contributor
Jan 03, 2024

Upload files using curl from Linux

I need to upload files programmatically via script from linux machines using curl and used the below command:

curl --ntlm --user <username:password> --upload-file fullbackup.gz sharepointendpoint -verbose

Tried with and without --ntlm, without ntlm getting 401 error, without --ntlm getting 403 error as below:

X-Forms_Based_Auth_Required: https://rapventures-my.sharepoint.com/_forms/default.aspx?ReturnUrl=/_layouts/15/error.aspx&Source=%2fpersonal%2frajarajacholan_k_rap_ventures%2fDocuments%2fAttachments%2ffullbackup.gz
< X-Forms_Based_Auth_Return_Url: https://rapventures-my.sharepoint.com/_layouts/15/error.aspx
< X-MSDAVEXT_Error: 917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.

 

Can you suggest me the right way to do it?

 

Thank you

 

No RepliesBe the first to reply