[
https://issues.apache.org/jira/browse/CB-2501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13582693#comment-13582693
]
Max Woghiren commented on CB-2501:
----------------------------------
FileUtils.getMimeType doesn't work at all for content:// URIs. They look like
"content://media/external/images/media/2199", and
MimeTypeMap.getFileExtensionFromUrl doesn't work when that's passed in. So
I've added functionality to handle that case.
The pull request is [here|https://github.com/apache/cordova-android/pull/18].
This is different from but related to the original scope of this bug, which is
what I tried to outline with my previous comments. If you think I should put
this back how it was and just make a new bug, I can do that.
> FileUtils.getMimeType(String file) does not work for content:// URIs
> --------------------------------------------------------------------
>
> Key: CB-2501
> URL: https://issues.apache.org/jira/browse/CB-2501
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Affects Versions: 2.2.0
> Reporter: Christian Kuetbach
> Assignee: Max Woghiren
> Priority: Minor
> Fix For: 2.4.0
>
>
> There is a bug in Android:
> http://code.google.com/p/android/issues/detail?id=8806
> Because of this the returned mime type will be wrong, if the file extension
> is not lowercase.
> myImage.jpg -> image/jpg
> myImage.JPG -> null
> I will provide a patch, which simply converts the filepath to lower case, but
> think there is a better solution than using the MimeTypeMap. The Class
> ContentResolver has a method getType()
> http://developer.android.com/reference/android/content/ContentResolver.html#getType(android.net.Uri)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira