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

Can't read files from cordova.file.applicationDirectory on cordowa-browser platform

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-plugin-file
    • Labels:
      None

      Description

      I'm attempting to copy files from my cordova.file.applicationDirectory to my cordova.file.dataDirectory on the cordova-browser platform with cordova-plugin-file. resolveLocalFileSystemURL fails (with error code 5) because applicationDirectory is at http://localhost:8000/ URL.

      The implementation of resolveLocalFileSystemURL in src/browser/FileProxy.js accounts for this by having a rule for lookups from applicationDirectory to be fetched via a GET request.

      The implementations in www/resolveLocalFileSystemURI.js and www/browser/Preparing.js do not handle this case. In most browsers the second is actually called, in Chrome it's the latter. I've yet to see the first implantation (FileProxy.js) get called.

      I'd love to fix this myself and submit a PR on github, but I'm having a bit of trouble understanding the reasoning between 3 different implementations, of which the most feature complete is never actually called.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              j005u Joonas Trussmann
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: