cordova 2.0.0 download file Android
- by N0rA
I tried to use cordova 2.0.0 API FileTransfer().download() and i got 2 consecutive errors
1) download error source file
2) download error target file
here is my code...
function downloadMaterial() {
var fileTransfer = new FileTransfer();
var serverURL = 'http://img.youm7.com/images/NewsPics/large/S2200921125437.jpg';
var uri = encodeURI(serverURL);
var filePath = persistent_root.fullPath+"/" + fileName;
//filePath = file:///data/data/com.example.studyapp/S2200921125437.jpg
var onSuccess = function (entry) {
console.log("download complete: " + entry.fullPath);
};
var onError = function (error) {
console.log("download error source " + error.source);
console.log("download error target " + error.target);
console.log("upload error code " + error.code);
};
fileTransfer.download(uri, filePath , onSuccess, onError);
}
Do you have any idea what should I do?
Thanks in advance ...