Resolution: Won't Fix
Affects Version/s: 1.6.0
Fix Version/s: None
Component/s: cordova-plugin-file-transfer (DEPRECATED)
PhoneGap CLI v6.3.0 (PhoneGap Android v5.2.1)
cordova-plugin-file plugin version 4.3.0
cordova-plugin-whitelist plugin version 1.3.0
cordova-plugin-camera version 2.3.0
On my app, I only made the change of upgrading from version 1.5.1 (released on April 2016) of the FileTransfer plugin to version 1.6.0 (released on September), but it's now failing to upload the file (as part of a process within the app that lets the user take a photo with the camera and upload it to the server) as it previously used to successfully.
Upon inspecting, the error being thrown is the FILE_NOT_FOUND_ERR, yet this error is thrown AFTER the plugin finished uploading the file, not before as one would expect if the file wasn't actually found.
So, once the server receives the empty upload, it returns a "411 Length Required" error response.
I reverted to version 1.5.1 and the problem disappeared, confirming there's a bug in version 1.6.0.
These were the parameters passed to the upload() method of the plugin (sensitive parts grayed out):
This was the upload progress as reported in the console log by the app:
Upload progress: 24.2% (17 KB of 68 KB) Submissions.js?_dc=1479249960076:290
Upload progress: 47.6% (33 KB of 68 KB) Submissions.js?_dc=1479249960076:290
Upload progress: 71.1% (49 KB of 68 KB) Submissions.js?_dc=1479249960076:290
Upload progress: 94.5% (65 KB of 68 KB) Submissions.js?_dc=1479249960076:290
Upload progress: 100% (68 KB of 68 KB) Submissions.js?_dc=1479249960076:290
And finally, here's the full error object returned by FileTransfer plugin right after the upload was completed at 100% (sensitive parts grayed out):
body: "<html>↵<head><title>411 Length Required</title></head>↵<body bgcolor="white">↵<center><h1>411 Length Required</h1></center>↵<hr><center>nginx/1.2.1</center>↵</body>↵</html>"