A jQuery client implementing the tus resumable upload protocol.
This first version will provide a low level API without a GUI. More advanced features will follow.
The code below outlines how the API could work.
$('input[type=file]').change(function() {
var options = {url: 'http://localhost:1080/files'};
tus
.upload(this.files[0], options)
.fail(function(upload, error) {
console.log('upload failed', error);
})
.progress(function(upload) {
console.log(upload.bytesSent, upload.bytesTotal);
})
.done(function(upload) {
console.log(upload.url);
});
});
Without installing anything, you can testdrive over at the tus.io website.
But for local development, here's how to run the repo-included demo:
- Install a tusd server to accept the upload on http://127.0.0.1:1080 as instructed here.
- Install node.js to serve the demo from http://127.0.0.1:8080
(osx:
brew install nodejs
) - Install & run the demo
cd demo
npm install
node server.js
- Point your browser to http://localhost:8080
This project is licensed under the MIT license, see LICENSE.txt
.