cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-9563) Mulptipart form data is used even a header named Content-Type is present
Date Mon, 23 Nov 2015 22:29:11 GMT

    [ https://issues.apache.org/jira/browse/CB-9563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15023231#comment-15023231
] 

ASF GitHub Bot commented on CB-9563:
------------------------------------

GitHub user daserge opened a pull request:

    https://github.com/apache/cordova-plugin-file-transfer/pull/117

    CB-9563 Mulptipart form data is used even a header named Content-Type…

    … is present
    
    Adds non-multipart implementation for Windows and a corresponding test
    Adds a fix for Android for uploadResult.bytesSent = 0 for small files

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MSOpenTech/cordova-plugin-file-transfer CB-9563

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-file-transfer/pull/117.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #117
    
----
commit 5a2f1740dcdfd41ee16b4164ef313c4cc25a64b1
Author: daserge <v-seshak@microsoft.com>
Date:   2015-11-23T22:20:00Z

    CB-9563 Mulptipart form data is used even a header named Content-Type is present
    
    Adds non-multipart implementation for Windows and a corresponding test
    Adds a fix for Android for uploadResult.bytesSent = 0 for small files

----


> Mulptipart form data is used even a header named Content-Type is present
> ------------------------------------------------------------------------
>
>                 Key: CB-9563
>                 URL: https://issues.apache.org/jira/browse/CB-9563
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File Transfer
>            Reporter: Alex Mantsurov
>
>  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



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message