Download files
Get a short-lived link to one file, and choose whether browsers show it or save it.
Get a download link
curl -X POST "$STORAGE_URL/buckets/invoices/downloads" \
-H "Authorization: Bearer $STORAGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"key": "2026/0001.pdf"}'The answer holds a url and when it stops working, 15 minutes later:
{
"data": {
"method": "GET",
"url": "https://files.digitospace.com/s/…/0001.pdf",
"headers": {},
"expiresAt": "2026-09-26T10:15:00Z"
}
}Fetch the file from url. It needs no API key, so you can hand the link to a browser. The link ends in the file’s name, and it supports range requests, so video and audio can be streamed and downloads can resume.
Once the link expires it answers 410 Gone. Ask for a new one.
Show the file or save it
By default the link downloads the file as an attachment, named after the last part of its key, such as 0001.pdf. To let a browser show it instead, such as an image in a page, send "attachment": false:
-d '{"key": "photos/logo.png", "attachment": false}'Keep links private
Anyone with the link can download the file until it expires, and it cannot be withdrawn early. Ask for a new link each time someone needs the file, and never store links or put them in logs.
Last updated