PhoneGap では、[APP HASH]/Documents または [APP HASH]/tmp フォルダー以外のファイルを読み取ることはできません。これらのフォルダーのいずれかにあるデータを使用してアプリを初期化する方法が見つからない限り、別の方法でデータを取得する必要があります。以下のコードが機能することがわかりました。基本的に、ローカル ファイルを一時フォルダーにダウンロードし、ファイル エントリを提供します。
window.requestFileSystem(LocalFileSystem.TEMPORARY, 0, function(fs){
fs.root.getFile("temp", {create: true, exclusive: false},
function(entry){
fileTransfer.download(
Url, // the filesystem uri you mentioned
entry.fullPath,
function(entry) {
// do what you want with the entry here
console.log("download complete: " + entry.fullPath);
},
function(error) {
console.log("error source " + error.source);
console.log("error target " + error.target);
console.log("error code " + error.code);
},
false,
null
);
}, function(){
alert("file create error");
});
}, null);