convex-file-storage
Installation
SKILL.md
Convex File Storage
Built-in file storage for every Convex deployment — upload, store, serve, and delete files with no extra packages.
Critical Rules
- Use
v.id("_storage")for storage ID validators, notv.string(). - Authenticate before
generateUploadUrl()— never expose upload URLs to unauthenticated users. - Always delete both storage AND database record —
ctx.storage.delete()removes the blob, but your metadata document in the DB must be deleted separately. ctx.storage.store()is action-only — mutations cannot store blobs directly; usegenerateUploadUrl()for client uploads instead.ctx.storage.getUrl()returns temporary URLs — don't persist them in the database; generate fresh URLs at query time.- HTTP Action uploads are limited to 20MB — use the upload URL method for larger files (no size limit, 2min upload timeout).
- Use
ctx.db.system.get()for metadata —ctx.storage.getMetadata()in actions is deprecated. - Use
Promise.all()to batchgetUrl()calls when listing multiple files with URLs.
Two Upload Methods
| Feature | Upload URLs (recommended) | HTTP Actions |
|---|
Related skills