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

Shazron Abdullah commented on CB-7566:
--------------------------------------

Note: this may be true of iOS, but we have to check the other platforms as well 
so they are consistent.

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

Reply via email to