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

Mulptipart form data is used even a header named Content-Type is present

    XMLWordPrintableJSON

Details

    Description

      I'm uploading media files to Amazon S3.

      ft.upload(
      path,
      url,
      function(result)

      { console.log(result); }

      ,
      function(error)

      { console.log(error); }

      ,
      {
      httpMethod : 'PUT',
      fileName : name,
      mimeType : type,
      chunkedMode : false,
      headers:

      { 'Content-Type' : type, 'x-amz-acl' : 'public-read' }

      }
      );

      After uploading the binary is wrapped:

      --+++++org.apache.cordova.formBoundary Content-Disposition: form-data; name="file"; filename="photo_032.jpg" Content-Type: image/jpeg Content-Length: 43084

      {binary data}

      -+++++org.apache.cordova.formBoundary-

      So, multipart data IS USED, but according to the docs:
      if a header named Content-Type is present, multipart form data will NOT be used

      Expected result:
      if a header named Content-Type is present, multipart form data will NOT be used

      Attachments

        Activity

          People

            daserge Sergey Shakhnazarov
            terreb Alex Mantsurov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: