Skip to content
cartage

Resumable uploads

An upload is a session made of numbered parts. Parts are independent, verified one by one, and kept for 7 days, so any client can pick up where another stopped.

Session life cycle

  • open: created with the transfer; parts can be written in any order.
  • complete: you called /complete and every declared byte is present and verified.
  • expired: no part arrived for 7 days (1 day on Dock). Stored parts are deleted 24 hours later.

Part rules

  • Part size is chosen when the session is created: 5 MiB to 128 MiB, default 16 MiB. Every part except the last must be exactly that size.
  • A transfer can have up to 10,000 parts. A 100 GB transfer at 16 MiB is 6,400 parts.
  • Re-sending a part with the same bytes is safe and returns 200. Different bytes for a stored part return 409.
  • The X-Cartage-Sha256 header is required. A mismatch returns 422 checksum_mismatch and stores nothing.

Resuming

Ask the session what it already has, then send only what is missing.

curl https://mirror-fr.edokus.ru/api/v1/uploads/u_71c2 -H "Authorization: Bearer $CARTAGE_TOKEN"

{"session": "u_71c2", "state": "open", "part_size": 16777216,
 "parts_total": 3840, "parts_stored": 41,
 "missing_ranges": [[42, 3840]], "expires_at": "2026-11-12T09:41:07Z"}

The CLI does this for you: cartage resume u_71c2 compares the folder on disk with missing_ranges and refuses to continue if a file has changed since the first run.

Choosing parallelism

Eight parallel parts of 16 MiB saturate a 2 Gbit/s connection from most of Europe and the US east coast. From a long-distance link, raise parallelism before raising part size. Past 16 streams the extra TCP connections rarely help and the API will return 429 to protect other customers.

Browsers resume from IndexedDB. If the user clears site data, the session still exists on our side for 7 days; ask them to sign in and choose Continue upload.

Downloads resume too

Download links honour Range requests, so curl -C -, browsers and download managers continue interrupted files. Every response includes an ETag and a Content-Length that stay stable while the link is alive.