Upload API

This article demonstrates how to use the uploadUrl response from the Generate File Upload Url endpoint to upload a file to a site's Media Manager.

注: Due to limits on the size and duration of files that you can upload, we recommend using the importFile() function. See Wix Media: Supported Media File Types and File Sizes for more details.

Authorization

This endpoint uses the upload token included in the url for authorization. No additional authorization is needed.

Syntax

コピー
1

Headers Params

名称タイプOptional説明
Content-TypeストリングnoFile content type. For example, "image/jpeg" for a jpg file.

Query Params

名称タイプOptional説明
filenameストリングnoFile name that appears in the media manager. Include the file's extension in the name to prevent potential errors.

注: In case of failure due to incorrect mimeType, include the file's extension in the filename parameter and set the Content-Type to 'application/octet-stream'. Doing this allows Wix servers to detect the correct content type of the file.

リクエスト

コピー
1

注: Receiving a successful response does not indicate that the upload is complete. To run code when the upload finishes, use the onFileDescriptorFileReady() そして onFileDescriptorFileFailed() events. Learn more about knowing when a file is ready.

Response

コピー
1

Status/Error Codes

Errors from this endpoint will include an HTTP status code.

役に立ちましたか?
はい
いいえ