Skip to main content
Uploads a file through the Dreep API in one multipart request. Simplest option, good up to a few hundred MB — for anything larger, or for uploads originating in a browser, use upload_presigned().

Signature

Omit folder, key and folder_id and the asset lands in the project’s default folder. See Folders & Paths for how paths resolve.

Returns

An Asset:

Transforming on upload

Anything in transform is applied before storage, so the transformed result is what gets stored and returned. The original is not kept.
This counts against your plan’s monthly transformation quota. Transforming at delivery time with url() instead keeps the original intact and serves any number of variants from it.

Uploading bytes

bytes carry no filename, so pass one — otherwise the API can’t infer the type:
A file object works too, and is read as it is sent:

Errors

Uploads are never retried automatically — a repeat would store the file twice and bill it twice. See Errors & Retries.