Android Phonegap Filetransfer.download() Recieving Error Code 3
I am trying to use FileTransfer.download() but seem to get 'error code 3' no matter what I try. Any help is greatly appreciated. I am using cordova 2.1 and zend studio 10 which is
Solution 1:
So I finally found the problem. It was a CORS issues
I had the correct setting in my cordova config.xml
<accessorigin=".*" />
However, when Zend studio built out my android project this setting did not get transferred over to my res/xml/config.xml
After adding the access origin line in that file everything started working as expected.
Solution 2:
i solved this error. Need to add 'true' parameter after fail callback function, see below code and cheer guys.
fileTransfer.download(
"http://www.w3.org/2011/web-apps-ws/papers/Nitobi.pdf",
"file:///sdcard/theFile.pdf",
function(entry) {
alert("download complete: " + entry.fullPath);
},
function(error) {
alert("download error s`enter code here`ource " + error.source);
alert("download error target " + error.target);
alert("upload error code" + error.code);
}, true);
Post a Comment for "Android Phonegap Filetransfer.download() Recieving Error Code 3"