Skip to main content
Use the Storage service for file storage in queries, mutations, actions, and HTTP actions. Import it from your generated services module:
The service is available in every context, but each operation retains Convex’s context restrictions. Confect checks these requirements when you implement a function or middleware. Every operation returns an Effect. The table lists the value produced when it succeeds.

Get a download URL

Retrieve a blob’s download URL with getUrl. The result is a URL object, not a string. If the blob doesn’t exist, the effect fails with BlobNotFoundError.

Generate an upload URL

Generate a URL that a client can use to upload a blob. generateUploadUrl is an Effect property, so yield it without parentheses. It produces a URL object.

Delete a blob

Delete a stored blob by its storage ID. If deletion fails, the effect fails with BlobNotFoundError.

Get a blob

Read a stored file directly as a Blob. If the blob doesn’t exist, the effect fails with BlobNotFoundError.

Store a blob

Store a Blob directly and receive its storage ID. Optionally supply a SHA-256 hash in options for Convex to verify.