Skip to content

Commit

Permalink
#6 - Implemented blob URI functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsuess committed Dec 1, 2014
1 parent 08476c8 commit e6d2ec2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,17 @@ Slingshot.Upload = function (directive, metaData) {
}

if (status !== "failed" && status !== "aborted" && self.file) {
var url = dataUri.get();
var URL = (window.URL || window.webkitURL)

if (url)
return url;
if (URL)
return URL.createObjectURL(self.file);

if (Tracker.active && window.FileReader) {
var url = dataUri.get();

if (url)
return url;

var reader = new window.FileReader();

reader.onloadend = function () {
Expand Down

0 comments on commit e6d2ec2

Please sign in to comment.