getFileUrl( )
Deprecated.
This function will continue to work, but a newer version is available. Use the getDownloadUrl
function instead.
Description
Note: The new
getDownloadUrl
function contains additional parameters.
Gets a temporary download URL with a token from the Media Manager for a specified file.
The getFileUrl()
function returns a Promise that resolves to
a download URL for the specified file.
Pass a Media Manager file URL in the fileUrl
parameter,
as returned in the fileUrl
property from the getFileInfo()
,
importFile()
, and upload()
functions.
Syntax
function getFileUrl(fileUrl: string): Promise<string>
getFileUrl Parameters
NAME
TYPE
DESCRIPTION
The file's Wix media URL in the following format: 'wix:image://v1/<uri>/<filename>#originWidth=<width>&originHeight=<height>[&watermark=<watermark_manifest_string>]'
.
Note: This replaces the old fileName
parameter. fileName
will continue to work, but we recommend that you use the updated fileUrl
parameter instead.
Returns
Fulfilled - The file's download URL.
Return Type:
Was this helpful?
Get a file's URL
This example uses a deprecated function.
1import { mediaManager } from 'wix-media-backend';23export async function getFileUrl(fileUrl) {4 return mediaManager.getFileUrl(fileUrl);5}67/* Returns a promise that resolves to:8 * https://download-files.wix.com/_api/download/file?downloadToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9eyJpc3MiO...9 */10