convex-file-storage

Implement Convex file storage workflows with upload URLs, serving, metadata, and deletion.

Updated May 4, 2024
One-click install
npx skills add https://github.com/kcrlee/dots --skill convex-file-storage-kcrlee
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-file-storage
Source: https://github.com/kcrlee/dots/tree/main/claude/.claude/skills/convex-file-storage
Command: npx skills add https://github.com/kcrlee/dots --skill convex-file-storage-kcrlee

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build reliable file workflows in Convex without guessing at the right storage patterns, covering uploads, serving URLs, metadata lookup, and cleanup.

Core Features & Use Cases

  • Upload flows: Generate upload URLs and connect client-side uploads to stored file records.
  • File delivery: Retrieve public or temporary URLs and render images, PDFs, and downloads correctly.
  • Generated assets: Store blobs created in actions, such as PDFs or images produced from external services.
  • Lifecycle management: Read storage metadata, validate file type and size, and delete both the stored blob and its database reference.
  • Use case: A product app can let users upload avatars, preview images before submission, and remove old files safely when records are deleted.

Quick Start

Ask for a Convex file storage implementation that generates upload URLs, saves file metadata, serves downloadable links, and deletes stored blobs safely.

Frequently Asked Questions about convex-file-storage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle file uploads in Convex and connect them to database records?

Convex file uploads require generating a upload URL, sending the client-side file to that URL, then saving the returned storage ID as metadata in your database records. This Skill implements that full workflow including client-side validation.

What is the best way to serve files and images stored in Convex to users?

Serving files in Convex involves retrieving public or temporary URLs from the _storage system table to render images, PDFs, and downloads. This Skill provides patterns for file delivery and metadata access for database-backed applications.

How do I safely delete a file blob and its database reference in Convex?

Deleting files in Convex requires coordinated cleanup of both the stored blob and its corresponding database reference. This Skill implements lifecycle management to remove file records and stored assets safely when records are deleted.

Can I store generated assets like PDFs from server-side actions in Convex storage?

Storing generated assets in Convex supports blobs created in actions, such as PDFs or images produced from external services. This Skill covers server-side action outputs and generated asset storage within app workflows.

Does Convex file storage support validating file type and size before uploading?

Convex file storage workflows can validate file type and size on the client side before generating upload URLs. This Skill applies client-side validation and reads storage metadata to enforce lifecycle constraints.