The Wix Media API provides the functionality to manage media files and folders in a site's Media Manager. Learn more about Wix Media.
To use the wix-media API, import
wixMedia from the
Generate File Download Url vs. Generate Files Download Url The Generate Files Download Url generates a permanent URL for downloading a compressed file containing specific files in the Media Manager. However, the Generate File Download Url generates one or more temporary URLs for downloading a specific file in the Media Manager. You can use the
expirationInMinutesparameter to set the URL expiration time, making it more secure than the Generate Files Download Url. Therefore, to download private files, use the Generate File Download Url for each private file that you want to generate a download Url for, instead of the Generate Files Download Url.
Generate File Resumable Upload Url vs. Generate File Upload Url The Generate File Upload Url generates an upload URL to allow external clients to upload a file to the Media Manager. However, any interruption in the upload process stops the file upload. For files larger than 10MB, or when network connection is poor, use the Generate File Resumable Upload Url instead. With the resumable upload URL, any interruption in the upload process pauses the file upload, and resumes the file upload process after the interruption.
Using the generated upload and resumable upload URLs When you get the
uploadUrlresponse from Generate File Upload Url, learn how you can use it to upload a file to the Media Manager. When you get the
uploadUrlresponse from Generate File Resumable Upload Url, learn how you can use it to resumably upload a file to the Media Manager.
System folders: Folders in the Media Manager's file system directory. There are 3 types of system folders:
Root Folders: Main categories of folders in the Media Manager.
MEDIA_ROOT: Contains all files and folders in the Media Manager's 'Site Files' tab in the UI.
MEDIA_ROOTsystem folder is different from the
media-rootfolder of the Media Manager. The
MEDIA_ROOTsystem folder contains all media in all levels of the 'Site Files' tab in the UI, while the
media-rootfolder of the Media Manager only contains the media in the root level of the 'Site Files' tab in the UI.
TRASH_ROOT: Contains all files and folders in the Media Manager's 'Trash' tab in the UI.
VISITOR_UPLOADS_ROOT: Contains all files and folders created by site visitors or members.
VISITOR_UPLOADS_ROOTfolder is located in the 'Site Files' tab in the UI. However, it is its own root folder and doesn't return when searching in the
Virtual Folders: Special categories of folders in the Media Manager that are hidden from the UI and can't be deleted.
MOBILE_UPLOADS: Contains all media uploaded using mobile devices.
PURCHASED_ITEMS: Contains all media imported using a purchase flow.
VIDEO_MAKER: Contains all videos created using Wix Video Maker. Located in the 'Site Files' tab in the UI.
File Assets Wix Media files are optimized for web use. When a file is imported or uploaded to the Media Manager, it is processed and may produce several variations of the file for use in different circumstances.
- A video file can have different resolutions and formats.
- An audio file can have different formats and qualities.
- Video or audio files can have a preview asset containing only a portion of the file.
With the Generate File Download Url, you can use the
assetKeysparameter to download different assets of a file.
Media Types: Supported media types include the following:
- Model 3D
Learn more about media file types and size limits.
Was this helpful?