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

FileTransfer v1.6.0 throwing weird FILE_NOT_FOUND_ERR



    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.6.0
    • None
    • None
    • 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

    • Important


      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": {},

      { "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):
      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"




            Unassigned Unassigned
            aplimovil Abraham Lopez
            0 Vote for this issue
            2 Start watching this issue