0
PhoneGap App Developing에서 초보자입니다. Android 4.1.2과 cordova-2.6.0을 사용합니다. 여기에 무슨 문제가 있습니까? 사람은PhoneGap에서 오류 코드 1을 수정하는 방법 FileTransfer()
function photoDownload(url, target) {
var url = encodeURI(url);
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {
var imagePath = fs.root.fullPath + "/" + target; // full file path
// fs.root.fullPath returns "file:///storage/sdcard0/"
//var imagePath = "/storage/sdcard0/" + target; // try another full file path
var fileTransfer = new FileTransfer();
fileTransfer.download(
url,
imagePath,
function (entry) {
alert("success" + entry.fullPath); // entry is fileEntry object
},
function (error) {
alert("error source " + error.source);
alert("error target " + error.target);
alert("error code " + error.code);
},
true,
{
headers: {}
}
);
})
}
그것은 파일을 찾을 수 없습니다 의미 오류 코드 1을 반환합니다 .... 내가이 일을 할 수 있습니다. 그러나 나는 할 수있는 모든 방법을 시도했다.
<div style="font-size: 22px;" onclick="photoDownload('url', 'save');">Download</div><br/><br/>
<div style="font-size: 22px;" onclick="photoDownload('http://aponblog.com/inc/images/globe.png', 'globe.png');">Download</div><br/>
<div style="font-size: 22px;" onclick="photoDownload('http://aponblog.com/inc/images/globe.png', 'TestFolder/globe.png');">TestFolder/Download</div><br/><br/>
<div style="font-size: 22px;" onclick="photoDownload('https://graph.facebook.com/simplyapon/picture?width=100&height=100', 'simplyapon.jpg');">S Download</div><br/>
<div style="font-size: 22px;" onclick="photoDownload('https://graph.facebook.com/simplyapon/picture?width=100&height=100', 'TestFolder/simplyapon.jpg');">S TestFolder/Download</div><br/>