Serverless file store
Moving a megabyte through a system with a token limit
A two-way file store an AI assistant and a phone browser can both use, holding no server state at all.
- Year
- 2026
- on the worker
- Zero state
- Stack
- Cloudflare Workers, R2, TypeScript
- Status
- Live
The problem
Getting a file from an AI assistant to a phone, or the other way, without emailing it to yourself. One worker plays three roles: a tool endpoint the assistant calls, a raw upload endpoint for large files, and the backend for a mobile web page.
The constraint
File content cannot travel through a model's context window. A megabyte of bytes is not something you pass through a conversation, and base64 makes it worse.
The decision
Uploads use short-lived signed tickets. The assistant asks for a ticket, which is small, and the bytes then go straight from the client to object storage without passing through the conversation or being buffered in the worker.
The worker holds no state at all, which is what makes it safe to run at the edge with no database. Access control is unguessable identifiers rather than a session. A scheduled sweep enforces expiry and burn-after-download, and archive handling has explicit size caps so a compressed bomb cannot expand into the worker's memory.
Note
The public URL is passphrase-gated, so there is no useful screenshot of the interface. The diagram above is the part worth seeing anyway.
At a glance
- State
- None on the worker
- Storage
- R2 object storage
- Access
- 128-bit unguessable ids
- Expiry
- Scheduled sweep