CB-4899 [BlackBerry10] Improve binary file transfer download

This commit is contained in:
Bryan Higgins
2014-01-09 11:24:08 -05:00
parent 73541fb5a2
commit 613ee821df
+2 -2
View File
@@ -146,7 +146,7 @@ module.exports = {
xhr = new XMLHttpRequest();
function writeFile(entry) {
entry.createWriter(function (writer) {
entry.nativeEntry.createWriter(function (writer) {
fileWriter = writer;
fileWriter.onwriteend = function (evt) {
if (!evt.target.error) {
@@ -188,13 +188,13 @@ module.exports = {
xhr.onprogress = function (evt) {
win(evt);
};
xhr.open("GET", source, true);
for (var header in headers) {
if (headers.hasOwnProperty(header)) {
xhr.setRequestHeader(header, headers[header]);
}
}
xhr.responseType = "blob";
xhr.send();
return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "async"};
}