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

[browser] Through plugin-file-transfer translated cdvfile:// URL not accepted by plugin-file

    XMLWordPrintableJSON

    Details

      Description

      When using this cordova-plugin-file-transfer snippet in the browser platform (using Chrome), the cdvfile path that is translated by the plugin, is not accepted by the cordova-plugin-file.

      var ft = new FileTransfer();
      ft.download(
          encodeURI('http://some.place/some.file'),
          'cdvfile://localhost/persistent/some/path',
          function (entry) {
              // do something
          },
          function (error) {
              // dummy
          },
          false
      );
      

      The file-transfer plugin rewrites the cdvfile URL to filesystem:http://localhost:8000/persistent/some/path. When this translated path is fed to cordova-plugin-file/www/browser/Preparing.js (the resolveLocalFileSystemURL function) it is not accepted by the 'are there two colons in the path'-check.

      So I guess there is something wrong with cordova-plugin-file-transfer accepting the localhost:8000 path, and cordova-plugin-file denying it. Not exactly sure what the fix would be.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              hvt Harm van Tilborg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: