Gets a temporary download URL with a token for a specified file in the Media Manager.
The getDownloadUrl()
function returns a Promise that resolves to
a download URL for a specified file in the Media Manager.
Pass the file's URL in the fileUrl
parameter, as returned
in the fileUrl
property of the getFileInfo()
, importFile()
, upload()
, and listFiles()
functions.
When the download URL is clicked, the specified file downloads to your device.
You can use the getDownloadUrl()
function to allow external clients to download a file from the Media Manager to their device.
This function provides a temporary URL for downloading a single file.
If you need permanent download URLs for one or more files, use the downloadFiles()
function.
Notes:
getDownloadUrl()
must be called for each file that you want to download.null
as a placeholder for any unspecified parameters. For example, to specify downloadedFileName
only, call getDownloadUrl(fileUrl, null, downloadedFileName, null)
.
The file's Wix media URL in the following format: 'wix:image://v1//#originWidth=&originHeight=[&watermark=]'
.
The time (in minutes) it takes for the download URL to expire.
Defaults to 600
. Limit is 525600
(1 year).
The downloaded file's name. Defaults to the file's name displayed in the Media Manager.
The redirect URL for when the download URL with a token has expired. Defaults to a 403 Forbidden response page.