2 Replies Latest reply on Apr 18, 2016 11:44 AM by little_drop

    Phonegap app doesn't show all folders in app folder



      I have a problem. When I start the phonegap app and the Desktop application on windows, the app on my phone doesn't seem to download all files!

      I put a folder www/books in my app but when I access the www folder via cordova.file.applicationDirectory it doesn't show this folder :-(

      Is that a problem of the app, or is something wrong with my code?


      Thanks for answering



        window.resolveLocalFileSystemURL(cordova.file.applicationDirectory + "www/",function (fileSystem) {

            var reader = fileSystem.createReader();


              function (entries) {

                    var i;

        for (i=0; i<entries.length; i++) {




              function (err) {





          }, function (err) {




        • 1. Re: Phonegap app doesn't show all folders in app folder
          kerrishotts Adobe Employee

          Unfortunately, you're running into one of the cases where the PhoneGap Desktop + PhoneGap Developer apps are different from building and deploying your app on a device.


          In the latter case, your files would be stored in the application bundle and deployed to the device. This is where cordova.file.applicationDirectory points.


          However, in the former case, you're using another PhoneGap app (PG Developer), and it's just loading content from a server (PhoneGap Desktop). Unfortunately, there is no mechanism to copy files into another app's bundle (bundles are considered read-only), and so whatever you see at cordova.file.applicationDirectory is actually the PhoneGap Developer app's bundle, which is not what you expect, of course.


          There are two ways around this:

          1. Temporarily download the content from your dev machine using XHR or File Transfer, or,
          2. Build your app with PhoneGap / Cordova CLI / PhoneGap Build. This will ensure that your app's assets are copied into the application bundle, and accessible via cordova.file.applicationDirectory. (This would be my suggestion; otherwise you'd have to rip out code associated with #1 when you're ready to test your build process.)


          Hope that helps!

          1 person found this helpful
          • 2. Re: Phonegap app doesn't show all folders in app folder
            little_drop Level 1

            Thanks for the answer.


            Solution 1) I don't know how to perform a download of a whole folder with a lot of folders with html files in these. I could zip the folder and download it from my webspace, but don't know how to unzip it.

            Solution 2) Building the app everytime I change two lines of code, transfer it to the phone, installing it is actually way to much effort for me..