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.
Authorization
This endpoint uses the upload token included in the url for authorization. No additional authorization is needed.
Syntax
1
Headers Params
Name | Type | Optional | Description |
---|---|---|---|
Content-Type | string | no | File content type. For example, "image/jpeg" for a jpg file. |
Query Params
Name | Type | Optional | Description |
---|---|---|---|
filename | string | no | File name that appears in the media manager. Include the file's extension in the name to prevent potential errors. |
Note: 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.
Request
1
Note: Receiving a successful response does not indicate that the upload is complete. To run code when the upload finishes, use the Descriptor File Ready and Descriptor File Failed webhooks. Learn more about knowing when a file is ready.
Response
1
Status/Error Codes
The response will include an HTTP status code.