Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-7273

Using cordova.file.applicationDirectory, Android, and reading the file

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-plugin-file
    • Labels:
      None
    • Environment:

      Android

      Description

      I wrote a simple app that uses the file system API to read a file from the www folder. The demo code may be found here:

      https://github.com/cfjedimaster/Cordova-Examples/blob/master/readtextfile/

      It uses this line essentially to handle the read:

      window.resolveLocalFileSystemURL(cordova.file.applicationDirectory + "www/index.html", gotFile, fail);

      This works fine in iOS, but fails to work in Android. While you can work around this by just using a regular XHR get, the code really should work.

        Attachments

          Activity

            People

            • Assignee:
              jasongin Jason Ginchereau
              Reporter:
              cfjedimaster Raymond Camden
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: