cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-11316) Content-Type not set for multi-part file
Date Wed, 17 Aug 2016 14:55:22 GMT

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

ASF subversion and git services commented on CB-11316:
------------------------------------------------------

Commit 9dc41bd4e97eafe80fb9bc6573396fcab5967708 in cordova-plugin-file-transfer's branch refs/heads/master
from [~ben3005]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-plugin-file-transfer.git;h=9dc41bd ]

CB-11316 windows: Added content-type for files

- added Content-Type header for each file in the multipart upload

 This closes #149


> 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