Abraham Lopez created CB-12152:
----------------------------------

             Summary: FileTransfer v1.6.0 throwing weird FILE_NOT_FOUND_ERR
                 Key: CB-12152
                 URL: https://issues.apache.org/jira/browse/CB-12152
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin File Transfer
    Affects Versions: 1.6.0
         Environment: PhoneGap version CLI-6.3.0 (PhoneGap 5.2.1 for Android)
cordova-plugin-file plugin version 4.3.0
cordova-plugin-whitelist plugin version 1.3.0
            Reporter: Abraham Lopez


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):
==========
FILE: file:///data/user/0/**********files/files/photo-revision_26_298-64671.jpg

OPTIONS: {
        "mimeType": "text/plain",
        "fileName": "file.jpg",
        "chunkedMode": false,
        "headers": {},
        "params": {
                "type": "revision",
                "hash": "102819597d5b1850b527034757825a7ed8299a4f",
                "checklist_activity_id": "298",
                "fileName": "photo-revision_26_298-64671.jpg",
                "fileURL": 
"file:///data/user/0/**********/files/files/photo-revision_26_298-64671.jpg"
        }
}
==========

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):
==========
FileTransferError
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>"
code: 1
exception: "https://**********/stage/asesores/api/AttachPhoto";
http_status: 411
source: 
"file:///data/user/0/app.oxxo.asesores/files/files/photo-revision_26_298-64671.jpg"
target: "https://**********/stage/asesores/api/AttachPhoto";
==========



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to