Skip to main content

Storage

JavaScriptDartSwiftKotlinJavaPythonGoPHPRustC#C++

EdgeBase Storage provides file storage built on Cloudflare R2 with $0 egress fees. Upload and download files with per-bucket access rules, generate time-limited signed URLs for secure sharing without authentication, and handle large files with resumable multipart uploads. Attach custom metadata to any file and control access with auth-aware read, write, and delete rules.


Features

📤

Upload / Download

Simple file operations with per-bucket access rules

🔗

Signed URLs

Time-limited access links for secure sharing (no auth required)

📎

Multipart Upload

Resume-capable uploads for large files (state tracked via KV)

🏷️

Metadata

Attach custom key-value metadata to any file

🔒

Access Rules

Per-bucket read, write, delete rules with auth context

Quick Example

// Upload a file
const result = await client.storage.bucket('photos').upload('photo-001.jpg', file, {
customMetadata: { uploadedBy: currentUser.id },
});

// Get public URL (synchronous — no network call)
const url = client.storage.bucket('photos').getUrl('photo-001.jpg');

// Download as blob
const blob = await client.storage.bucket('photos').download('photo-001.jpg');

// Signed URL (no auth needed to access)
const signedUrl = await admin.storage.bucket('photos').createSignedUrl('photo-001.jpg', {
expiresIn: '1h',
});
Admin SDK Coverage

Server-side storage operations such as signed URL generation and privileged file access are available across all Admin SDKs.

Access Rules

// edgebase.config.ts
storage: {
buckets: {
photos: {
access: {
read() { return true }, // Public read
write(auth) { return auth !== null }, // Auth required
delete(auth, file) { return auth !== null && auth.id === file.uploadedBy },
},
},
},
}

Next Steps