upload( )

Uploads a file to the Media Manager from a buffer.

The upload() function returns a Promise that resolves to information about the newly uploaded file.

Video and audio files that have been uploaded aren't immediately available to be used even after the Promise is resolved. Before they can be used, they must first undergo transcoding. The onFileUploaded() event is triggered when a file has been uploaded and before the transcoding is finished.

To import a file to the Media Manager directly from a URL, use the importFile() function.

To enable site visitors to upload files to your site, you can also use an upload button.

Note: There are limits on the size and duration of files that you can upload. See Wix Media: Supported Media File Types and File Sizes for more details.

Method Declaration
Method Parameters

The path within the Media Manager where the file will be uploaded.

If the path doesn't yet exist, the missing folders will be created, for example: /media/files.

If metadataOptions.isVisitorUpload is true (default), the visitor-uploads folder is the root of the file path, in this case, visitor-uploads/media/files/.


Buffer containing the content to be uploaded.


In this case the fileName is the name you would like your file to appear as in the Media Manager.


Options to use when uploading the file.

Return Type:Promise<FileInfo>
Was this helpful?