server/src/defs/storage_schema.ts, sync them with edgespark storage apply, and use the runtime SDK in your routes.
For browser-facing file transfer, EdgeSpark should usually issue presigned URLs instead of proxying file bytes through your Worker. Use direct put() and get() when the server itself is creating, reading, or transforming the bytes.
Declare buckets
Add bucket definitions toserver/src/defs/storage_schema.ts:
server/src/defs/storage_schema.ts
Store server-generated content
server/src/index.ts
Issue a download URL for clients
server/src/index.ts
Read a file server-side
When the server itself needs the bytes, useget() directly:
server/src/index.ts
List and delete files
server/src/index.ts
Use presigned URLs for direct uploads
For client-originated uploads, generate a presigned URL and upload directly to R2:server/src/index.ts
See also
storage reference
Complete storage API: put, get, list, delete, and presigned URLs.
Platform limits
File size and runtime constraints for uploads and downloads.