안녕하세요. Phonegap을 사용하여 iOS 응용 프로그램을 만들고 있습니다. Filetransfer API를 사용하여 이미지 파일을 다운로드하고 있습니다. 내가이 문제를 해결하려면 어떻게Phonegap iOS에서 파일을 다운로드하는 중 오류가 발생했습니다.
FileTransferError {
body = "Could not create path to save downloaded file: You don\U2019t have permission to save the file \U201cMyRecipeDirectory\U201d in the folder \U201cMonarch13A452.J72OS\U201d.";
code = 1;
"http_status" = 200;
source = "https://www.facebookbrand.com/img/fb-art.jpg";
target = "cdvfile://localhost/root/MyDirectory/test.jpg";
}
: 나는 내가 오류가 무엇입니까 iOS 장비에서 실행하면 파일을
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, createFolder, null);
function createFolder(fileSystem) {
console.log('gotFS');
fileSystem.root.getDirectory("MyDirectory", {
create: true,
exclusive: false
}, MyDirectorySuccess, MyDirectoryfail);
}
function MyDirectorySuccess(entry) {
console.log('gotDirectorySuccess');
downloadFile(entry);
}
function downloadFile(entry)
{
console.log('downloadFile');
var filePath = entry.fullPath+'test.jpg';
var fileTransfer = new FileTransfer();
var url = 'https://www.facebookbrand.com/img/fb-art.jpg';
fileTransfer.download(
url, filePath, function(entry) {
console.log("success");
}, function(error) {
console.log("error");
}, true, {});
}
을 다운로드하려면 다음 코드를 사용하고?