mazharul / tus-jquery-client

A jquery plugin implementing the tus resumable upload protocol.

Home Page:http://tus.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tus-jquery-client

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.

Example

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);
    });
});

Try the demo

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:

cd demo
npm install
node server.js

License

This project is licensed under the MIT license, see LICENSE.txt.

About

A jquery plugin implementing the tus resumable upload protocol.

http://tus.io/

License:MIT License