Resumable uploads: large files that survive a bad connection
Short answer: A normal file upload is all or nothing: if the connection drops at 90%, the customer starts again from zero. Resumable uploads split a large file into pieces and remember how much arrived, so an interrupted upload continues from where it stopped. Use your storage provider's multipart or resumable upload feature, or the open tus protocol, upload directly from the browser or app to storage, show real progress, and clean up uploads that never finish.
When ordinary uploads fail
Business apps increasingly ask customers and staff to upload big files: site-inspection videos, architectural drawings, photo sets from an event, scanned document bundles, backups. On a good office connection a single upload request copes. In real conditions it often doesn't:
- Mobile data drops as someone walks between rooms or rides through a tunnel.
- Rural broadband stalls for a few seconds.
- A laptop goes to sleep mid-upload.
- A web server or proxy times out a long request.
Each failure throws away everything sent so far. Customers retry a few times, then email the file, use a sharing link, or give up.
How resumable uploads work
The idea is the same across implementations:
- Start an upload session. The client asks the server or storage service for an upload ID or session URL.
- Send the file in parts, or as a stream the server tracks by offset.
- After an interruption, ask how much arrived, then send only the rest.
- Complete the upload, at which point the file becomes a normal object.
The tus protocol, an open specification for resumable uploads over HTTP, shows the mechanism clearly: a HEAD request returns the current Upload-Offset, and the client resumes with a PATCH request carrying the remaining bytes from that offset. Its example continues a 100-byte upload interrupted at 70 bytes by sending the last 30.
Option 1: your storage provider's feature
Cloud object storage services have resumable or multipart uploads built in.
Amazon S3 multipart upload. AWS's documentation describes splitting an object into parts, each with a part number from 1 to 10,000, uploading them independently, then completing the upload. It recommends multipart upload for objects of 100 MB or larger, citing improved throughput from parallel parts and quick recovery from network issues, because only a failed part needs to be re-sent.
Google Cloud Storage resumable uploads. Google's documentation explains that starting a resumable upload creates a session with a unique session URI, which the client, including a web browser, sends data to in one or more requests. It says each session remains active for up to a week, so uploads can resume after network dropouts.
Other providers offer similar features. Check their part-size limits and how long incomplete uploads are kept.
Option 2: tus
If you want one protocol across storage back ends, or your files go to your own servers, tus has client libraries for browsers and mobile platforms and server implementations for several languages, some of which store files in cloud storage behind the scenes. The client library handles chunking, retries and resuming, including after a page reload if you let it remember the upload.
Upload directly to storage
For large files, avoid routing data through your web application servers:
- Your app creates the upload session or signed part URLs and gives them to the client.
- The browser or mobile app sends file data straight to storage.
- Your app receives a notification, or the client reports completion, and records the file.
This keeps web servers free for normal requests, avoids their request timeouts, and makes the upload faster.
Show progress honestly
Large uploads need clear feedback:
- A real progress bar based on bytes confirmed, not a spinner.
- A message when the upload pauses because the connection dropped, and when it resumes.
- A warning before the user closes the page while an upload is running.
- On mobile apps, background upload support, so switching apps doesn't cancel it.
If the upload can resume after the page reloads, say so: "You can close this page and come back; your upload will continue."
Clean up what never finishes
Incomplete uploads leave pieces behind:
- For S3, incomplete multipart uploads keep their uploaded parts until aborted. A lifecycle rule that aborts incomplete multipart uploads after a few days stops them accumulating.
- For other services, check how long sessions or partial data persist and whether you're charged for them.
- In your own database, expire upload records that never completed, and tell the user if they started something that didn't finish.
Handle the edge cases
A few situations deserve thought before launch. If the same user starts uploading the same file twice, from two tabs or after a crash, decide whether to resume the existing session or start fresh. If a user's login expires mid-upload, make sure signed upload URLs last long enough, or can be renewed without losing progress. And if your app limits file sizes, check the limit before the first byte is sent, not after the upload completes.
Check files after upload
Resumable uploads change how bytes arrive, not whether they're trustworthy. After completion:
- Verify the size and, where the service supports it, a checksum.
- Check the file type by inspecting the content.
- Process the file, such as scanning, resizing or transcoding, in a background job.
A worked example
Consider a hypothetical Whanganui surveying firm whose field staff uploaded drone footage and site photos from rural locations. Uploads of several hundred megabytes often failed on patchy mobile connections, and staff drove back to the office to upload on Wi-Fi. The developer switched the app to multipart uploads straight to object storage, with parts retried individually, a progress screen that showed pauses and resumes, and a lifecycle rule to clean up abandoned uploads. Most uploads now finish from the field, even through dropouts.
FAQ
What part size should I use?
It depends on the provider's limits and your users' connections. Smaller parts lose less on failure; larger parts mean fewer requests. Test with real conditions.
Does resumable upload make uploads faster?
Often, because parts can upload in parallel and failures only cost one part. On a perfect connection the gain is smaller.
Can I use it for small files?
You can, but it adds overhead. Most apps use normal uploads below a size threshold and resumable ones above it.
If large uploads keep failing for your customers or staff, tell us what they're uploading.