Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.5.0
-
None
-
OS: Windows 10
Cordova CLI: 6.1.1
cordova-plugin-file-transfer: 1.5.1
Description
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
by changing the following code:
var fileToUploadPart = new Windows.Networking.BackgroundTransfer.BackgroundTransferContentPart(fileKey, fileName); fileToUploadPart.setFile(storageFile); transferParts.push(fileToUploadPart);
To:
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);
Attachments
Issue Links
- links to