Upload & Download Shared Files using Curl

Creating shares (see our article here) allows users to access the shares with their browser but it also allows automated uploads and downloads using scripts and tools such as `CURL`.

Downloading a File using Curl

To download a file from a share using a tool or curl it's important to get url to the share first. This URL can be found from the share creation page.

The command download a file looks like this using the drive-id and share-id from the created share:

curl "https://share.diode.link/download/<drive-id>/<share-id>/<filename>"

Uploading a File using Curl

Similarly to the download the upload url is constructed from the share link but using the the "upload" prefix. For uploading it is important to use the http post method and specify the uploaded file content using html form format in a field called data. When using curl this can be done by using the -X parameter to specify the http method and the -F parameter to specify the data form parameter

curl -X POST "https://share.diode.link/upload/<drive-id>/<share-id>/file.png" -F 'data=@file.png'

How did we do?

Powered by HelpDocs (opens in a new tab)

Powered by HelpDocs (opens in a new tab)