convex-file-storage
Complete file handling with uploads, URL serving, generated file storage, deletion, and metadata access in Convex.
- Supports three-step upload flow: generate upload URL via mutation, POST file to storage endpoint, save reference to database
- Serves files via automatic URL generation and handles diverse file types (images, PDFs, videos) with type-specific display logic
- Stores generated files from actions (PDFs, images) directly to storage using
ctx.storage.store()with Blob conversion - Accesses file metadata including creation time, SHA256 hash, content type, and size via the
_storagesystem table - Includes client-side validation for file type and size, preview generation, and cascading deletion of storage and database records
Convex File Storage
Handle file uploads, storage, serving, and management in Convex applications with proper patterns for images, documents, and generated files.
Documentation Sources
Before implementing, do not assume; fetch the latest documentation:
- Primary: https://docs.convex.dev/file-storage
- Upload Files: https://docs.convex.dev/file-storage/upload-files
- Serve Files: https://docs.convex.dev/file-storage/serve-files
- For broader context: https://docs.convex.dev/llms.txt
Instructions
File Storage Overview
More from waynesutton/convexskills
convex
Umbrella skill for all Convex development patterns. Routes to specific skills like convex-functions, convex-realtime, convex-agents, etc.
5.5Kconvex-best-practices
Guidelines for building production-ready Convex apps covering function organization, query patterns, validation, TypeScript usage, error handling, and the Zen of Convex design philosophy
3.1Kconvex-functions
Writing queries, mutations, actions, and HTTP actions with proper argument validation, error handling, internal functions, and runtime considerations
2.4Kconvex-schema-validator
Defining and validating database schemas with proper typing, index configuration, optional fields, unions, and migration strategies for schema changes
2.2Kconvex-realtime
Patterns for building reactive apps including subscription management, optimistic updates, cache behavior, and paginated queries with cursor-based loading
2.1Kconvex-cron-jobs
Scheduled function patterns for background tasks including interval scheduling, cron expressions, job monitoring, retry strategies, and best practices for long-running tasks
2.0K