AlgoViz

How Large Uploads Work

easy 38 min

A large file goes up in small numbered pieces.

Where it shows up

The same pattern appears across everyday software.

  • A school play on a phone

    The video uploads on the bus. Between two masts the signal goes for a minute. The app waits, sends the same piece again and the server tells it where to continue.

  • File sync

    Dropbox's API offers upload sessions with a session ID and an offset. A wrong offset is answered with the correct one, so a lost reply repairs itself.

  • Video sites

    YouTube's resumable protocol: after a break the client asks with an empty PUT, reads 308 and the Range header, and sends only the rest.

  • Backups to object storage

    Backup tools send numbered parts to S3 in parallel. A failed part is sent again under the same number and replaces the earlier one.

  • Web forms with tus

    A form page uses a tus client. It stores the upload's URL in the browser, and after a reload the user chooses the file and the rest is sent.

  • A hospital scanner on a slow line

    Large images leave at night. Every piece has a checksum, and the file is visible to doctors only after the whole hash is right.

  • Cameras at a nature park

    Solar cameras wake up, send as many pieces as the battery allows, and sleep. The server's offset is the only memory they need besides the ID.