Form Data
Last updated
Last updated
The form-data endpoint can be obtained through the pluginApi:
pluginApi.media.formDataUploadUrl
In addition to the headers described in , we also require the following headers to be set:
upload-length
The size of the uploaded media/file.
Here's an example of including these data using Uppy:
new Uppy().use(XHR, {
endpoint: pluginApi.media.formDataUploadUrl,
headers: (file) => ({
"csrf-token": appData.getCSRFToken(),
"organization-id": pluginApi.pluginContext.organizationId,
...(file.size
? {
"upload-length": file.size.toString(),
}
: {}),
}),
})