Get a link to a stored file
get_storage_file_url
Returns a link to one stored file so it can be opened or downloaded.
For a public file it returns the permanent public CDN address by default, or, with download set to true, a signed link that forces a save-as. That signed link needs no login and stays valid for 7 days, so treat it as a shareable secret.
A private file never has a public address: both modes return a signed link that expires after 15 minutes, for opening the file now rather than embedding it in a page. On a site whose CDN has not finished being provisioned, a public file also comes back as a signed link valid for 7 days.
Pass the full key exactly as list_storage_files returned it, not just the filename, since a key with no file behind it is refused with a 404. Files in the CMS folder at the top level, which the CMS manages, get a link like any other, and the tool keeps working while a storage backup is being restored. See Public and private.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
key |
string | Yes | The full key of the file, from list_storage_files. |
download |
boolean | No | True for a temporary signed download link instead of the public CDN address. |