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

Parameters

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

Returns

sizeBytes is a number. The API sends it as a string — Postgres BIGINT columns serialise that way over JSON — and the SDK converts it, so a.sizeBytes + b.sizeBytes adds rather than concatenating.

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 a stream

A Node Readable is read fully into memory before sending, because fetch can’t stream a multipart body. For large files that’s a reason to prefer presignUpload(), which sends the bytes straight to storage.

Errors

Uploads are never retried automatically — see Errors & Retries.