$cordovaFile.checkDir says folder does not exist but $cordovaFile.createDir says folder already exists

南楼画角 提交于 2019-12-05 22:44:04

Those are promises, are you using them like that :

$cordovaFile.checkDir(cordova.file.dataDirectory, "inbounds")
      .then(function (success) {
        // success
        alert("status " + success);


      }, function (error) {
        // error
      });

Have you configured your config.xml too ?

<preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
<preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,root" />

OK, I am adding this as an answer although aorfevre started the whole ball rolling. The issue I had primarily was that I had not added the necessary lines to my config.xml file which provided access to the device's filesystem.

Although after doing this I still had issues the key thing I was doing wrong was building and redeploying the app over the top of the existing installation. As soon as I manually uninstalled the app and deployed it fresh, it started working fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!