Skip to content

Commit

Permalink
#22: Allow uploads for Blob.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuess committed Jan 4, 2015
1 parent 32e1a64 commit daea6e6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,14 @@ Slingshot.Upload = function (directive, metaData) {
},

/**
* @param {File} file
* @param {(File|Blob)} file
* @param {Function} [callback]
* @returns {Slingshot.Upload}
*/

send: function (file, callback) {
if (window.chrome && window.navigator.vendor === "Google Inc.") {
check(file, window.File);
} else {
// not Google chrome
if (! (file instanceof window.File))
throw new Error("Not a file");
}
if (! (file instanceof window.File) && ! (file instanceof window.Blob))
throw new Error("Not a file");

self.file = file;

Expand Down

0 comments on commit daea6e6

Please sign in to comment.