Add drag-and-drop file upload to a web page that automatically resumes if the user's connection drops.
Upload large video or document files in chunks with progress tracking and automatic retry on failure.
Let users close and reopen the browser mid-upload and pick up where they left off using the test-mode chunk handshake.
Requires writing server-side chunk handling and reassembly logic, no library handles the server side for you.
Resumable.js is a JavaScript library that makes it possible to upload files to a server in a way that can survive network interruptions. Instead of sending a file as one big transfer, the library splits it into small pieces called chunks. If a chunk fails to upload, the library retries that piece automatically. If your internet connection drops entirely, the upload can pick up where it left off once the connection returns, rather than starting over from scratch. The library works entirely inside the browser using a built-in browser feature called the HTML5 File API. It has no other dependencies, meaning you do not need to install any extra tools or packages to use it. It works in Firefox 4 and later, Chrome 11 and later, Safari 6 and later, and Internet Explorer 10 and later. On the user-facing side, you point the library at a button or a drop area on your web page. Users can then click to browse for files or drag and drop them in. Once a file is added, the library handles everything: splitting, uploading, retrying failed pieces, and tracking overall progress. You can listen for events to know when a file has been added, when it finishes successfully, or when an error occurs. On the server side, you need to write code that receives each chunk and saves it. The library sends extra information alongside each chunk, including the chunk number, total number of chunks, file size, and a unique identifier for that file. Once all chunks arrive, your server code reassembles them into the complete file. The README includes notes on which HTTP status codes the library treats as success, which it treats as a permanent failure, and which it treats as a cue to retry. There is also an optional test mode where the browser asks the server before uploading each chunk whether that chunk already exists. This lets uploads resume even after closing and reopening the browser. Configuration options cover chunk size, number of simultaneous uploads, parameter names sent to the server, and many other details. Sample code is included in the repository.
← 23 on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.