gpt4 book ai didi

javascript - Cordova 3.4.0 : File Api GetFile Abort Error

转载 作者:行者123 更新时间:2023-11-28 08:04:10 25 4
gpt4 key购买 nike

最近将我的应用程序的 Cordova 框架升级到 3.4.0

我曾经在iOS应用程序的Documents目录中编写一个文件。文件访问代码片段如下所示。

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');
}
);

在新版本的 cordova(3.4.0) 中,无法获取文件条目并抛出错误代码 = 3,即 ABORT_ERR

请帮我解决这个问题。因为我的完整模块取决于此。任何帮助是极大的赞赏。提前致谢。

最佳答案

挖掘Cordova FILE插件后,发现在最新版本中传递的文件路径应该是相对的。引用here

关于javascript - Cordova 3.4.0 : File Api GetFile Abort Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24990960/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com