File Transfer Plugin Updated to 0.4.2 on PhoneGap Build

  • 1
  • Announcement
  • Updated 6 years ago
If you're using the file-transfer plugin on build, its been updated to version 0.4.2. To lock to this new version in your config.xml:

<gap:plugin name="org.apache.cordova.file-transfer" version="0.4.2" />

Or, if you'd like to continue to use the previous version:

<gap:plugin name="org.apache.cordova.file-transfer" version="0.3.3" />
Photo of ryan

ryan, Developer

  • 1538 Posts
  • 132 Reply Likes

Posted 6 years ago

  • 1
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Works so far as advertised. Thank you!
Photo of Michael McKenzie

Michael McKenzie

  • 4 Posts
  • 0 Reply Likes
I'm having an issue. App ID 855952.

Every time I try to download a file I receive an error status of 1, or FILE_NOT_FOUND_ERR. However, I can guarantee that the URL is correct and correctly encoded, the file exists on the server, the local directory path on the device exists and is read/write, and I am also able to create files on the device in the desired directory path. My code was working a few days ago but now, for some reason, I keep getting this error.

When I look at my network traffic from the device (I have it going through Fiddler as a proxy) it does not make any requests to the server, and the network tab in Chrome's remote debugger does not record any network traffic either. I can make XMLHttpRequest calls to the same server and this process works, and I see that request in the network tab.

As a test, I just reverted my file transfer plugin back to version, 0.3.3, and everything works correctly.

I am using a Nexus 4 with Android 4.4.2 and using Cordova 3.3.0 with all plugins set to use the latest version.

Any thoughts? :)
Photo of Michael McKenzie

Michael McKenzie

  • 4 Posts
  • 0 Reply Likes
I've found a solution. Looking through the commits in Github I found something under the "Backwards Compatibility Notes".

https://github.com/apache/cordova-plu...

It says that using an absolute file path is supported for compatibility, but that they recommend using entry.toURL() to produce a filesystem URL. I was using entry.fullPath to produce my file path, but that is what was failing because entry.fullPath produces a file path and not a file URL, which is what would happen in the previous FileEntry API. Switching to using entry.toURL() has resolved my problem.