The problem
Uploading a multi gigabyte file over a flaky network will fail partway. Without resumability the client restarts from byte zero, wasting everything sent so far. Resumable upload makes the upload recover from where it stopped.
How it works
- The client opens a session and gets a session id that names the in progress upload.
- It sends the file as a sequence of byte ranges, each tagged with its offset.
- The server records the highest contiguous offset it has durably received.
- After a failure the client asks the server how far it got, then resumes from that offset.
The server, not the client, is the source of truth for progress, because only it knows what was durably stored. Each range write should be idempotent: resending the same offset must not duplicate bytes.
Key idea
Resumable upload tracks the highest durably received offset on the server so an interrupted transfer continues from the gap, with idempotent range writes preventing duplication.