Direct Upload (S3 / Spaces)
When ASSET_DIRECT_UPLOAD=true and the project disk is s3, clients can upload straight to the bucket with presigned URLs (and multipart for large files). Classic POST /files remains available.
Requires project token create. Run a queue worker so image finalize jobs complete.
Single-object flow
- [POST]
/files/upload-url— initiate; returns upload URL + asset pending info - Client PUTs the file to the signed URL
- [POST]
/files/upload-finalize— finalize; images may enterpending_image_processing
Multipart flow
- [POST]
/files/multipart/initiate - [POST]
/files/multipart/part-url— per part - Client uploads parts
- [POST]
/files/multipart/complete
Threshold/part size: see env.
CORS
Allow your CMS origin and PUT on the bucket. Multipart complete uses S3 ListParts (browsers need not read ETag).
Example (initiate)
curl -X POST "https://your-domain.com/api/files/upload-url" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_PROJECT_TOKEN" \
-H "project-id: YOUR_PROJECT_UUID" \
-d '{"filename":"large-video.mp4","content_type":"video/mp4"}'See Asset Library and classic Upload an Asset.