0
我有點困惑與科爾多瓦的iOS文件傳輸方法。 (我有一個Android版本)文件傳輸下載與科爾多瓦3.4 iOS 7的
顯然,我沒有正確設置目標文件夾。 target:null
Could not create target file
請注意,我認爲該目錄存在,因爲它是在腳本的早期成功創建的。
根據科爾多瓦文件,我應該使用entry.toURL
來找到正確的道路。
function download(filename){
var localPath = rootFS.toURL+'contentImages/'+filename;
var fileTransfer = new FileTransfer();
fileTransfer.download(encodeURI('http://myValidatedSource.com/'+filename),
localpath,
function(entry){
console.log('download completed for '+entry.fullPath);
},
function(error){
console.log(error);
}
);
}
我也試過這樣:
alert(rootFS.fullPath); ==> "/"
和
alert(rootFS.toURL); ==> "function(){
if (this.nativeURL){
return this.nativeURL;
}
return this.toInternalURL()|| "file://localhost"+this.fullPath";
}"