You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Jonathan Aquino (JIRA)" <ji...@apache.org> on 2014/09/17 01:40:33 UTC
[jira] [Created] (CB-7566) FileTransfer: Doc incorrectly says that
mimeType defaults to "image/jpeg"
Jonathan Aquino created CB-7566:
-----------------------------------
Summary: FileTransfer: Doc incorrectly says that mimeType defaults to "image/jpeg"
Key: CB-7566
URL: https://issues.apache.org/jira/browse/CB-7566
Project: Apache Cordova
Issue Type: Bug
Components: Plugin File Transfer
Reporter: Jonathan Aquino
Priority: Trivial
The documentation for mimeType at https://github.com/apache/cordova-plugin-file-transfer/blob/master/doc/index.md says
"mimeType: The mime type of the data to upload. Defaults to image/jpeg."
However, if you look at the code in https://github.com/apache/cordova-plugin-file-transfer/blob/master/src/ios/CDVFileTransfer.m you will see that mimeType is actually not sent if it is unset:
if (mimeType != nil) {
[postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Type: %@\r\n", mimeType] dataUsingEncoding:NSUTF8StringEncoding]];
}
I recommend changing the doc from "Defaults to image/jpeg." to "If unspecified, no Content-Type will be sent."
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)