我尝试使用cordova 2.0.0 API FileTransfer().download(),我得到2个连续错误1)下载错误源文件2)下载错误目标文件
这是我的代码...
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);
}
你知道我该怎么做吗?提前致谢 ...