Skip to content

Upload FAQ

Answers to common questions about how Storage handles uploads.

Find out how Storage checks policies, expires uploads, and handles failures.

When are uploads checked against policies, and when do they expire?

Policy checks depend on the authorization mode of the request:

This table shows when Storage checks policies and when uploads expire, for requests that use a user access token.

Upload typePolicy checks (user access token)Expiry
StandardAt the start and at completionNone
ResumableOn each POST, PATCH, and DELETE request, and at completion24 hours
SignedWhen the signed upload URL is created2 hours
Resumable with a signed URLWhen the signed upload URL is created2 hours

For non-signed uploads, a policy change in the middle of an upload causes the upload to fail if the user is no longer authorized. For signed uploads, policy changes after the signed URL is created don't affect the upload.

You can't revoke a single signed URL. To revoke all signed URLs (upload and download), rotate and revoke the Storage signing key used to sign them. After revocation, new requests to signed URLs on the old key fail. A signed upload already in progress can finish only the request it's currently sending.

For resumable uploads with a signed URL, this means new requests, for example to upload the next chunk, fail because the x-signature token no longer matches the current signing key.

Can an upload complete after expiry?

Yes. An upload can complete after the expiry if the final request was initiated and verified before the expiry time.

What happens to partial files from failed or abandoned uploads?

An upload can fail or stop before completion, for example because of a network failure during a standard upload or an abandoned resumable upload. Supabase is designed to clean up any partial files left over through automated cleanup tasks. You can't manually trigger a cleanup, and you can't access the backend file service directly to review the raw file system.

If partial files aren't cleaned up in some scenario, you can detect them by comparing your storage size from object metadata with the average daily storage size on your organization usage page. On the usage page, select the same project that you queried with SQL. The SQL query returns the exact size at the time you run it, while the usage page averages the size over the day, so small differences are expected.

If the difference is significant, open a support ticket so the Supabase team can review your project. If you think partial files weren't cleaned up, share the steps that led to the situation. A storage size mismatch can also happen if you delete file metadata directly with SQL instead of using the Storage APIs, which leaves orphaned files. Never delete Storage data with SQL.

Does an upload complete if the client loses connection?

Uploads don't require final confirmation from the client:

  • If the client loses connection after sending all the data, the upload can complete without the client receiving the final response.
  • If a standard upload's client disconnects before the file finishes uploading, Storage treats the upload as failed and removes any partially uploaded data.

To know when an upload has completed, use triggers on storage.objects.

How are simultaneous uploads and deletion to the same file handled?

The request that finalizes last determines the outcome:

  • If the delete finalizes after the upload, the file is deleted and no longer exists at the path.
  • If the upload finalizes after the delete, the newly uploaded file is available at the path.

How do I view in-progress uploads?

Storage doesn't store a record of in-progress uploads that you can query. To track them, build a custom upload system between your end users and Storage that records each upload and marks it as completed when it finishes.

Is there a maintenance mode that blocks uploads?

No. To prevent writes, add a database trigger on storage.objects that raises an error. You can use similar triggers to prevent updates and deletions.

How do I enforce custom upload requirements?

If Storage doesn't natively support a requirement, build your own server code, for example with an Edge Function, that sits between your end users and Storage and enforces the extra requirements.