Resumable uploads make large-file transfers more tolerant of slow connections, browser interruptions, and temporary service failures. This guide explains how single-request, multipart, chunked, and resumable approaches differ, then shows how to design chunk numbering, retries, pause-and-resume behavior, assembly, expiration, cleanup, progress reporting, and integrity checks that remain understandable in production.
Overview
A basic upload sends one request containing the entire file. That model is easy to implement, but a failure near the end can force the client to send everything again. For small files on stable networks, the simplicity may be worthwhile. For larger files or mobile and intermittent connections, splitting the transfer into independently addressable parts can reduce wasted work.
The terms chunked, multipart, and resumable are related but not interchangeable. Chunking describes dividing a file into pieces. Multipart upload often describes a storage-provider protocol in which parts are uploaded separately and later completed. Resumability describes the ability to continue an interrupted session without restarting from byte zero. A system can use chunks without offering resume, or use a provider's multipart API while still needing its own session state and retry logic.
| Approach | How it works | Best fit | Main trade-off |
|---|---|---|---|
| Single request | The complete file is sent in one HTTP request. | Small files and simple forms | A late failure usually requires a full retry. |
| Multipart form upload | Form fields and a file are sent together, commonly as one request. | Standard web forms and straightforward APIs | It is not automatically resumable or split into storage parts. |
| Chunked upload | The client divides a file and sends pieces identified by position or number. | Large files and controlled application servers | The server must validate ordering, size, and assembly state. |
| Resumable multipart upload | Parts are uploaded independently and a session can continue after interruption. | Large files, unreliable networks, and object storage workflows | It requires session management, cleanup, and provider-specific coordination. |
Before choosing an implementation, define the file-size range, expected connection quality, maximum concurrency, storage target, authentication model, and retention policy. Also check the current documentation for the selected browser APIs, storage service, reverse proxy, and SDK. Limits and defaults can change, and a design that works against a local server may fail at a proxy or storage boundary.
What to track
A reliable upload is easier to operate when every transfer has an explicit state. Create an upload session with a server-generated identifier rather than trusting a filename as the identity. Store enough metadata to validate subsequent requests, such as the authenticated owner, original filename for display, total size, media type subject to validation, chunk size, creation time, expiry time, and current status.
Chunk identity and ordering
Give each piece a stable number or byte range. A common model uses a zero-based or one-based part number, but the choice matters less than documenting it and applying it consistently. The final chunk may be smaller than the configured chunk size. Reject ranges that exceed the declared file size, overlap incorrectly, or claim a size that does not match the received bytes.
Record the parts already accepted. A retry should be safe: if the same session receives a part again, the server can recognize the part number and compare its length or checksum instead of blindly appending duplicate bytes. Never assemble based only on arrival order, because network retries and parallel requests can arrive out of sequence.
Progress and retry state
Track confirmed bytes or confirmed parts separately from bytes currently in flight. The client can calculate visible progress from confirmed data, while the server remains the authority for what has actually been stored. For each failed request, classify the response where possible. Temporary network errors and service-busy responses may be retried; authentication failures, invalid ranges, rejected file types, and expired sessions generally require user or application action.
Use bounded retries with increasing delays and jitter rather than an immediate tight loop. Set a maximum attempt count or time window, and expose a clear “retry” action when automatic attempts stop. Concurrency should also be bounded. More parallel requests can improve throughput in some environments, but excessive concurrency increases memory pressure, throttling, and the number of states that must be recovered.
Integrity and security signals
For sensitive workflows, calculate an integrity value for each part, the complete file, or both. The server should verify data before marking a part complete and should verify the assembled object before publishing it. A checksum is an integrity control, not a substitute for authorization or malware scanning. Apply the file validation and storage controls described in secure file upload validation guidance, and use the checksum verification workflow when choosing an appropriate digest process.
Cadence and checkpoints
Implement the workflow as a sequence of checkpoints. Keeping these checkpoints explicit helps the client recover after a tab refresh and helps operators diagnose incomplete sessions.
- Initialize: authenticate the request, validate basic metadata, select a storage location, choose or confirm the chunk size, and return an upload-session ID. Do not publish the destination object yet.
- Number and send chunks: read the file using browser-supported file APIs, calculate each part's number or byte range, and send it with the session ID. Include enough metadata for the server to reject mismatched files.
- Confirm each part: return a durable acknowledgement only after the part has been accepted by the application or storage service. Save the part number and provider-specific part identifier if one exists.
- Retry safely: retry transient failures with bounded backoff. If the client is unsure whether a request succeeded, query the session before sending again. This avoids creating duplicate parts or incorrectly advancing progress.
- Pause and resume: pause should stop starting new requests and allow in-flight work to settle or be cancelled safely. On resume, query the server for accepted parts and send only the missing or invalid ones. A page refresh should follow the same reconciliation path.
- Complete: submit the ordered part list to the assembly endpoint or storage provider. The server should verify that all required parts exist, that the total size is plausible, and that the session belongs to the requester.
- Verify and publish: check the final object, apply file validation, and only then move it into the application's visible or permanent location. Return a stable file identifier rather than exposing temporary storage details.
- Expire and clean up: remove abandoned sessions, temporary parts, failed assemblies, and stale metadata. Cleanup should be idempotent, so running it twice does not damage a completed upload.
For browser interfaces, show confirmed progress, upload speed as an estimate, remaining activity, pause or cancel controls, and a useful error state. The accessible interface should also provide a label, keyboard-operable controls, and status updates that do not rely only on color; see the accessible file upload checklist.
Maintain a small operational record for each session: creation time, last activity, bytes confirmed, parts received, retry counts, completion result, and cleanup result. Review these values monthly or quarterly, depending on traffic and the cost of failed transfers.
How to interpret changes
A rising retry count does not automatically mean the upload algorithm is broken. Segment the data by browser, device type, network environment when available, file size, chunk size, region, and storage route. A problem concentrated in the largest files may indicate a timeout, proxy limit, memory issue, or provider constraint. A problem concentrated in one client environment may point to file-reading, cancellation, or background-tab behavior.
Compare the following signals together:
- Completion rate: the percentage of initialized sessions that reach verified publication.
- Resume success: whether interrupted sessions continue without restarting from zero.
- Duplicate-part rate: how often uncertain responses cause repeated submissions.
- Assembly failures: missing parts, incorrect ordering, size mismatches, or provider completion errors.
- Cleanup backlog: expired sessions and temporary parts that remain after the cleanup window.
- Integrity failures: mismatched checksums or objects that fail post-assembly validation.
If completion falls after changing chunk size, concurrency, a reverse proxy, a storage SDK, or a browser-facing code path, compare the affected release with the previous configuration. Keep changes isolated where possible. Before migrating providers, test initialization, duplicate handling, interruption, resume, completion, expiration, and integrity verification against the provider's current multipart documentation. For related server-side size constraints, consult the file upload size configuration reference.
When to revisit
Review the implementation on a monthly or quarterly cadence, and immediately after a major change to browser support, storage services, SDK behavior, reverse-proxy configuration, authentication, or file-validation rules. A recurring review is especially useful because upload failures are often environment-specific and may remain hidden until users transfer larger files over less reliable connections.
Use this deployment checklist before release:
- Test small, medium, and near-maximum-size files.
- Interrupt transfers during initialization, in-flight upload, and final assembly.
- Refresh the page, reopen the upload view, and confirm that the session can reconcile accepted parts.
- Submit duplicate chunks and out-of-order chunks; verify that neither corrupts the final object.
- Test pause, cancel, authentication expiry, expired sessions, and repeated completion requests.
- Confirm progress reflects server-confirmed data and does not exceed 100 percent.
- Verify final size, checksum or equivalent integrity signal, file-type controls, authorization, and publication state.
- Run cleanup and confirm that abandoned parts disappear without removing active or completed uploads.
- Recheck current browser, storage-provider, proxy, and SDK documentation whenever a dependency changes.
Keep the results with the release or infrastructure notes. When a transfer problem is reported, record the session state, part number, response class, retry history, and storage outcome without logging sensitive file contents. This turns a vague “upload failed” report into a reproducible workflow. For API-level testing, pair these scenarios with the multipart form-data testing checklist, then revisit this article whenever your upload path or storage workflow changes.