Skip to content

Commit

Permalink
Merge pull request #68 from wingedfox/master
Browse files Browse the repository at this point in the history
Bugfix for #65
  • Loading branch information
RubaXa committed Feb 12, 2013
2 parents 0799b55 + f8d68b8 commit fba1d01
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/FileAPI.Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,18 @@
queue.inc();
file.blob.toBlob(function (blob){
data.name = file.name;
data.file = blob;
data.size = blob.length;
data.file = blob;
data.size = blob.length;
data.type = file.type;
queue.next();
}, 'image/png');
}
else if( file.file ){
//file
data.name = file.blob.name;
data.file = file.blob;
data.size = file.blob.size;
data.file = file.blob;
data.size = file.blob.size;
data.type = file.type;
}
else {
// additional data
Expand Down
1 change: 1 addition & 0 deletions lib/FileAPI.XHR.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@

xhr.setRequestHeader("Content-Range", "bytes " + data.start + "-" + data.end + "/" + data.size);
xhr.setRequestHeader("Content-Disposition", 'attachment; filename=' + encodeURIComponent(data.name));
xhr.setRequestHeader("Content-Type", data.type || "application/octet-stream");

slice = data.file[slice](data.start, data.end + 1);

Expand Down

0 comments on commit fba1d01

Please sign in to comment.