valums/file-uploader — pull request #285 by rubenv (2012-08-07 05:26:32+00:00)
Title: Support for continuing a paused upload.

Returning false from onSubmit allows you to stop the upload. There is
currently no way to temporarily halt the upload and restart it later.

This commit adds a callback parameter to onSubmit, which can be used to
continue the upload later on.

We need this in the following situation:

* Imagine a document management application. The user is looking at
the "new document" screen, which is just a single upload field.
* When the user clicks submit, we'll pause the upload by returning
false from onSubmit.
* We then send another AJAX request to the backend, to create a new
entity.
* Once that returns, we use the returned value to set the target of
the uploader to the newly created ID and continue the uploader by
invoking cb(). This then attaches the file to the entity.