Skip to content

Commit

Permalink
Added Content-Type header
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Lebedev committed Feb 12, 2013
1 parent 0799b55 commit f8d68b8
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 f8d68b8

Please sign in to comment.