Skip to main content
A presigned upload sends the bytes directly to storage instead of through the API. Use it for large files, and whenever the bytes live somewhere your server can’t stream from — a browser, a mobile app. The API key is never involved in the PUT, so the upload URL is safe to hand to a client.

upload_presigned

Presign, stream the PUT and confirm, in one call. This is the path for large files on your own server: the bytes are streamed from disk in 1 MB chunks and never held in memory.
Takes the same destination arguments as upload(), plus: The source must be size-aware — a Path, bytes, or a seekable file object — because storage is told the exact size up front. The confirm is retried while the bytes settle, so the 409 the API answers in that window is handled for you.

presign_upload

Start the flow yourself when the bytes are uploaded by someone else, typically a browser.
The client must PUT with exactly the content_type and byte count that were presigned. Storage checks both and rejects a mismatch.

The browser flow

confirm_upload() is what turns the stored bytes into an asset. Until it runs, the upload is not listed by list_media().

Errors