Skip to main content
Every EdgeSpark project includes Cloudflare R2 object storage. You declare buckets in 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 to server/src/defs/storage_schema.ts:
server/src/defs/storage_schema.ts
Apply the declarations:
Inspect synced buckets with:

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, use get() 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
Default to presigned PUT and GET URLs for browser-facing file transfer. When you are working near request, file size, or runtime limits, link back to platform limits.

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.
Last modified on April 9, 2026