cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max Woghiren (JIRA)" <>
Subject [jira] [Commented] (CB-2501) FileUtils.getMimeType(String file) does not work for content:// URIs
Date Thu, 21 Feb 2013 14:46:13 GMT


Max Woghiren commented on CB-2501:

Thanks Christian.

Problem (2) is what I've addressed in my pull request.  I agree that FileUtils needs to be
somewhat revamped; I plan to look at this soon.  CB-2432 and CB-2435 are on my plate and will
likely result in some of the restructuring you're suggesting.

As a sidenote, you can sometimes get file:// URIs from content:// URIs—see FileUtils.getRealPathFromURI—but
it only works if it's a local file.  So yeah, your gmail example and the Picasa issue (CB-2432)
are good reasons why ContentResolver should be used.
> FileUtils.getMimeType(String file) does not work for content:// URIs
> --------------------------------------------------------------------
>                 Key: CB-2501
>                 URL:
>             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:
> 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()


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:

View raw message