【发布时间】:2015-12-27 17:39:49
【问题描述】:
晚上好,我正在phonegap中开发一个应用程序,我需要将图像下载到SD卡上,但出现错误,希望有人能帮助我,谢谢
<a href="#" onclick="downloadImagess()">Download File</a>
function downloadImagess(){
alert("download just started.");
var url = 'https://image.freepik.com/vector-gratis/glifos-egipto_23-2147522976.jpg';
var filename= 'Egipto';
try{
var ft = new FileTransfer();
ft.download(
url,
target_directory + filename,
function(entry) {
alert("download complete!:"); //path of the downloaded file
},
function(error) {
alert("download error" + error.code);
//alert("download error" + JSON.stringify(error));
}
);
}
catch (e){
//alert(JSON.stringify(e));
}
}
还留下了错误的图片 http://fotos.subefotos.com/850cbc202b844108ba7f2bddba098856o.png
【问题讨论】:
标签: android file cordova filesystems