File Storage (R2)
R2 is object/file storage for your Vulcan apps. Use it when users need to upload, download, or manage actual files — images, PDFs, CSVs, documents, anything.
What it is
Think of R2 like a cloud drive — it stores files by name and lets you retrieve them on demand. Unlike KV (which stores small structured data) or SQL (which stores records), R2 is for actual files: images, PDFs, documents, exports.
When to use R2
Use R2 when:
- Users need to upload files (images, documents, reports)
- Your app needs to store and serve files for download
- You're building a file manager, receipt scanner, or document library
- The app needs to generate and export files (CSV reports, generated PDFs)
Templates that use R2 by default:
- filemanager — Upload, download, delete files
- report-builder — Generate and store downloadable reports
How to add it to your app
Tell the AI what you need:
"Let users upload photos of their deliveries" "I need a file manager where the team can upload and download documents" "Store generated reports as downloadable CSV files"
The AI will provision an R2 bucket for your project and wire up the upload/download logic.
Preview vs production buckets
Preview and production each have their own separate file bucket. Files uploaded during testing don't appear in production.
File size and limits
R2 supports very large files. For any internal tool you'd realistically build, you'll never hit the limit.
Combining with other storage
R2 pairs well with SQL or KV for storing metadata alongside files. For example:
- R2 stores the actual PDF file
- KV or D1 stores the file name, uploader, date, and tags
The AI will handle this combination automatically when it makes sense for your app.