File Storage API
The Storage API provides temporary file storage powered by Cloudflare R2. Upload files via multiple methods and access them through a global CDN.Features
- Multiple Upload Methods: Base64, multipart/form-data, or remote URL
- Global CDN: Files served through Cloudflare’s edge network
- Automatic Expiration: Files automatically deleted after 1 day
- China Acceleration: Dedicated China endpoint for faster access
Authentication
All upload endpoints require Bearer token authentication:Base URL
Quick Example
Response Format
All upload endpoints return the same response format:Upload Methods
| Method | Endpoint | Use Case |
|---|---|---|
| File Upload | POST /api/upload/file | Direct file upload via form data |
| Base64 | POST /api/upload/base64 | Encoded data from browsers or APIs |
| URL | POST /api/upload/url | Download and store remote files |
Limits
- Maximum file size: 1 GB
- File expiration: 1 day
Next Steps
Upload File
Upload via multipart/form-data
Upload Base64
Upload base64-encoded data
Upload URL
Upload from remote URL
