My favorites | Sign in
Project Home Issues
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 11112: Allow applications to define MIME type to file extension mappings
16 people starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----

Sign in to add a comment
Reported by, Sep 8, 2010
MimeTypeMap provides mapping between MIME types and file extensions, but only for a hardcoded list of types.  Applications should be able to define new mappings.

Many applications generate files in custom formats and allow users to share those files.  For example, users might attach those files to emails or post them on websites.  Android uses MIME types as its primary means of identifying file types and selecting applications to process them.  For example, the Gmail app uses the MIME type of an attachment to select an app for previewing it.  If its MIME type is unknown, no Preview button is shown and the user cannot interact with the attachment in any way.

Unfortunately, the MIME type of a file can easily be lost.  For example, open the email on a desktop computer, save the attachment to disk, then attach it to a new email.  Or post the file on a website.  In this case, the file extension is the only indication of the file type.  For "standard" file types that are built into MimeTypeMap, that is sufficient.  But for application-defined file formats with different file extensions, there is no way to make use of that information.

To fix this problem, please allow a tag to be included in the application's manifest defining a custom file extension and the corresponding MIME type.  When the application was installed, its mapping would automatically be registered, and MimeTypeMap would produce the correct type for those files.

For more discussion of this issue, please see
Feb 27, 2014
Is there a workaround available for this issue?

Sign in to add a comment

Powered by Google Project Hosting