Skip to content

Commit

Permalink
Merge pull request #57 from srijs/feature-add-file
Browse files Browse the repository at this point in the history
Add possibility to add file manually.
  • Loading branch information
steffentchr committed Mar 18, 2013
2 parents 6057edc + 0838103 commit 9d21185
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Available configuration options are:
* `.cancel()` Cancel upload of all `ResumableFile` objects and remove them from the list.
* `.progress()` Returns a float between 0 and 1 indicating the current upload progress of all files.
* `.isUploading()` Returns a boolean indicating whether or not the instance is currently uploading anything.
* `.addFile(file)` Add a HTML5 File object to the list of files.
* `.removeFile(file)` Cancel upload of a specific `ResumableFile` object on the list from the list.
* `.getFromUniqueIdentifier(uniqueIdentifier)` Look up a `ResumableFile` object by its unique identifier.
* `.getSize()` Returns the total size of the upload in bytes.
Expand Down
3 changes: 3 additions & 0 deletions resumable.js
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ var Resumable = function(opts){
});
return(totalSize>0 ? totalDone/totalSize : 0);
};
$.addFile = function(file){
appendFilesFromFileList([file]);
};
$.removeFile = function(file){
var files = [];
$h.each($.files, function(f,i){
Expand Down

0 comments on commit 9d21185

Please sign in to comment.