Cloudflare Workers · Cloudflare R2 · JavaScript · Serverless · Wrangler
Overview
A serverless file upload and management system using Cloudflare Workers as the compute layer and Cloudflare R2 as object storage. There is no file size limit by default, making it well suited to machine learning model weights (.pt, .ckpt, .safetensors, etc.). The frontend can be hosted on Cloudflare Pages, GitHub Pages, or opened locally as a static HTML file. The backend Worker is deployed and managed with the wrangler CLI.
Interface preview
Click “Simulate upload” to feel the real drag-and-drop flow (this is a frontend mock and does not upload anything).Core features
- No file size limit; handles large model files without configuration changes
- Drag-and-drop upload interface with real-time progress and estimated time remaining
- Automatic file-type detection with matching icons
- Image preview and download for all file types
- File deletion from the management interface
- Cloudflare Workers handle upload, download, and delete API requests
- Flexible frontend hosting: Cloudflare Pages, GitHub Pages, or local static file
Architecture
Frontend and backend are fully decoupled. The Worker is deployed to Cloudflare’s edge withwrangler deploy; the frontend only needs the correct Worker URL and can be hosted anywhere.
Quick start
1
Install wrangler CLI and log in
2
Create an R2 bucket
3
Configure wrangler.toml
Fill in the Worker name, R2 bucket binding, and bucket name:
4
Update the frontend API URL
In
frontend/app.js, set API_URL to your Worker endpoint:5
Deploy the Worker
6
Deploy or open the frontend
Upload the
frontend/ directory to Cloudflare Pages or GitHub Pages, or open frontend/index.html directly in a browser.Notes
In practice
A practical fit for individuals or small teams who need a place to store large binary files (model weights, dataset archives) without running a backend server. It also works as a hands-on starting point for learning Cloudflare Workers and R2 together.Links
- GitHub: felimet/cf-auto-deploy-worker