Javascript Cordova 3.4.0:文件Api GetFile中止错误
最近将我的应用程序Cordova framework升级至3.4.0 我曾经在iOS应用程序的Documents目录下写过一个文件。 文件访问代码片段如下所示Javascript Cordova 3.4.0:文件Api GetFile中止错误,javascript,ios,file,cordova,Javascript,Ios,File,Cordova,最近将我的应用程序Cordova framework升级至3.4.0 我曾经在iOS应用程序的Documents目录下写过一个文件。 文件访问代码片段如下所示 var path = "/var/mobile/Applications/MyApp/Documents/tempDir/txtFile.txt"; window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem){
var path = "/var/mobile/Applications/MyApp/Documents/tempDir/txtFile.txt";
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0,
function(fileSystem){
fileSystem.root.getFile(path,{create:true, exclusive: false},
function(fileEntry){
console.log('gotFileEntry');
);
},
function(){
console.log('gotFileEntry fail');
}
);
},
function(){
console.log('fail');
}
);
在较新版本的cordova3.4.0中,无法获取fileentry并抛出错误代码=3,即ABORT_ERR
请帮我做这个。因为我的整个模块都依赖于此。
非常感谢您的帮助。提前谢谢 挖掘Cordova文件插件后,发现传递的文件路径在最新版本中应该是相对的。请参阅我猜测当前版本不允许您访问任意路径。您只需要指定文件名。尝试只指定文件名txtFile.txt而不是整个路径。@frank:谢谢您的回复