How it works
The client requests a session for a file and expected base revision, meaning the revision its edit started from. The API checks identity, write permission, and quota, then issues an expiring session or scoped storage permission. Numbered chunks let the client ask which byte ranges were accepted and resume only missing ranges after an interruption.
Take a 4 GB file in 8 MB chunks, which is 500 chunks. If the connection drops after 480 are acknowledged, the client asks for accepted ranges and resends 20 chunks: 160 MB, not 4 GB. S3 multipart upload and Google Cloud Storage resumable uploads work along these lines. Smaller chunks lose less on failure but cost more requests and session state, and small files may not need a session at all. Abandoned sessions also keep consuming storage until a cleanup rule removes them; S3 offers a lifecycle rule for incomplete multipart uploads.
At finalization, verify assembled size and checksum, inspect content according to policy, and record the ordered blocks. A content hash can help detect duplicates within an approved scope, but hash equality does not grant access. Compression helps text more than already-compressed media such as video. Encrypt stored content and manage keys separately. Make finalization idempotent, meaning a repeat has the same effect as the first call, so a timed-out retry does not create two revisions.
A 4 GB upload loses its connection near completion. How should it recover?
Resume its authorized session, request accepted ranges, send missing chunks, then verify and finalize once.
Use this as a guide for self review; written answers are not graded.Keep in mind
- Resumable chunks save bandwidth; checksums detect corruption.
- Durable receipt and published revision are separate states.