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-11316) Content-Type not set for multi-part file
Date Mon, 13 Jun 2016 11:00:24 GMT

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

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

GitHub user ben3005 opened a pull request:

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

    CB-11316 windows: Added content-type for files

    <!--
    Please make sure the checklist boxes are all checked before submitting the PR. The checklist
    is intended as a quick reference, for complete details please see our Contributor Guidelines:
    
    http://cordova.apache.org/contribute/contribute_guidelines.html
    
    Thanks!
    -->
    
    ### Platforms affected
    Windows
    
    ### What does this PR do?
    Adds Content-Type header for files in the multi-part upload
    
    ### What testing has been done on this change?
    ran `npm test`
    
    Tested plugin before with this result:
    ![aapche-before](https://cloud.githubusercontent.com/assets/2751508/16005224/061072c8-315e-11e6-9c7b-3a26c4e7129f.png)
    
    Tested forked change with the following result:
    ![aapche-after](https://cloud.githubusercontent.com/assets/2751508/16005241/18bfc39c-315e-11e6-9e4b-8fedecdc5443.png)
    
    
    ### Checklist
    - [x] [ICLA](http://www.apache.org/licenses/icla.txt) has been signed and submitted to
secretary@apache.org.
    - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) in the JIRA
database
    - [x] Commit message follows the format: "CB-3232: (android) Fix bug with resolving file
paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
    - [ ] Added automated test coverage as appropriate for this change.
    
    - added Content-Type header for each file in the multipart upload

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

    $ git pull https://github.com/ben3005/cordova-plugin-file-transfer master

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

    https://github.com/apache/cordova-plugin-file-transfer/pull/149.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 #149
    
----
commit b639542b57f66df1d78f589f7608ee6f2039872b
Author: Ben Marshall <ben3005@users.noreply.github.com>
Date:   2016-06-07T12:56:57Z

    CB-11316 windows: Added content-type for files
    
    - added Content-Type header for each file in the multipart upload

----


> Content-Type not set for multi-part file
> ----------------------------------------
>
>                 Key: CB-11316
>                 URL: https://issues.apache.org/jira/browse/CB-11316
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File Transfer
>    Affects Versions: 3.5.0
>         Environment: OS: Windows 10 
> Cordova CLI: 6.1.1
> cordova-plugin-file-transfer: 1.5.1
>            Reporter: Ben Marshall
>              Labels: Windows, Windows10, triaged
>
> When uploading a file as a muti-part file on windows 10 the "Content-Type" header for
the file is not set.
> This results in a request that has no content-type that reflects the type of the file.
> This can be resolved by setting a multi-part header after creating the 
> *BackgroundTransferContentPart*  
> [Link to GitHub file | https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/windows/FileTransferProxy.js#L369-#L371]
> by changing the following code:
> {code:JavaScript}
> var fileToUploadPart = new Windows.Networking.BackgroundTransfer.BackgroundTransferContentPart(fileKey,
fileName);
> fileToUploadPart.setFile(storageFile);
> transferParts.push(fileToUploadPart);
> {code}
> *To:*
> {code:JavaScript}
> var fileToUploadPart = new Windows.Networking.BackgroundTransfer.BackgroundTransferContentPart(fileKey,
fileName);
> // added the file mime type
> fileToUploadPart.setHeader("Content-Type", mimeType);
> fileToUploadPart.setFile(storageFile);
> transferParts.push(fileToUploadPart);
> {code}



--
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