Download file/folder from sharepoint using Curl/Wget automatically Download file/folder from sharepoint using Curl/Wget automatically curl curl

Download file/folder from sharepoint using Curl/Wget automatically


Please use rclone

Download and install the latest one from https://rclone.org/downloads

First option: Use OneDrive to access SharePoint sites/personal folder. This option will help you to upload large files.

1.create rclone configurations using the rclone config command

2.Select New remote and give a name

3.Select cloud storage OneDrive

4.Leave client ID and secret as blank

5.Edit advanced config: n

6.Remote config: Use auto-config: y

7.Open the URL on the browser and give access to rclone

8.Select personal/shared site URL option

8a.Shared site URL option you have to give the site URL. ie; https://sharepoint.com/sites/SiteName

9.Select personal/Documents drive. Documents drive will show if you selected the shared site URL option in the 8th step

  1. Save config and quit

And the configuration file contents will be like the following. If you selected the Personal option drive type will be personal.

[onedrive]type = onedrivetoken = drive_id = drive_type = documentLibrary

Second option: In this option, you can upload up to 2 GB-sized files.

1.create rclone configurations using rclone config command

2.Select New remote and give a name

3.Select cloud storage WebDAV

4.Give site URL, username and password

5.Save and quit

And the configuration file contents will be like the following. Password will be in an encrypted format.

vim /root/.config/rclone/rclone.conf

[sharepoint]type = webdavurl = https://sharepoint.com/sites/SiteName/Documentsvendor = sharepointuser = pass = 

Download a file from SharePoint.

rclone copy --ignore-times --ignore-size --verbose sharepoint:SourceFolder/file.txt DestFolder


Struggled with the same issue myself, and had my not-so-automatic-but-man-so-convenient way, with a daily log-in.

  1. logged into Sharepoint with a browser,
  2. exported the cookie,
  3. run the following command.

    wget --cookies=on --load-cookies cookies.txt --keep-session-cookies --no-check-certificate -m https://yoursharepoint.com 

And files were downloaded just fine.


Firefox plugin that captures the link with session ID etc.. and it provides a command you could paste in the console for curl or wget.

If anyone has a better suggestion please let me know.

It gives you a curl or wget command with headers, cookies and all, with a copy to clipboard button, right on the download dialogue.

Download URL: https://addons.mozilla.org/en-US/firefox/addon/cliget

Reference: https://superuser.com/questions/27243/how-to-find-out-the-real-download-url-on-download-sites-that-use-redirects/1239026#1239026