【问题标题】:Cordova getDirectory returns errorcodeCordova getDirectory 返回错误代码
【发布时间】:2014-02-17 11:08:18
【问题描述】:

我正在尝试访问 Cordova iOS 应用程序中的文件系统,但当我使用 getDirectory 方法时,它总是返回错误代码 3 (ABORT_ERR)。

我正在使用以下代码:

window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);

function onFileSystemSuccess(fileSystem) {
    console.log(fileSystem.name);
    dataDir = fileSystem.root.getDirectory("ozzie", {create: true}, getDir, fail);
}

function getDir(dir) {
    console.log("successfull got directory", dir);
}

function fail(error) {
    console.log("error", error.code);
}

返回fileSystem.name(“持久”),但它永远不会获取目录。这总是返回 error.code = 3,根据 phonegap 文档,它是 ABORT_ERR。

以前有人有过这种行为吗?

【问题讨论】:

  • 遇到同样的错误,你解决了吗?

标签: ios cordova


【解决方案1】:

可能你的问题是你尝试创建两个目录,例如:directory1/directory2

在 iOS 中,您应该先创建一个,然后再创建另一个。

在 iPad 中,Documents 目录不存在。

【讨论】:

    猜你喜欢
    • 2012-08-04
    • 1970-01-01
    • 2011-12-04
    • 2014-07-03
    • 1970-01-01
    • 1970-01-01
    • 2017-06-03
    • 2016-07-25
    • 1970-01-01
    相关资源
    最近更新 更多