MIME type is likely to be lost along the way…

In this post Peter Eastman has shared his experience of creating a customized type for his own application and shared from web/email client to his application. In his post, he explicitly mentioned that how the MIME type defined by him will be lost by email client.

Unfortunately, there are lots of other cases that don’t work.  Here’s a really basic one:

Open the email on your computer and save the attached file to disk.Now attach it to a new email.  This causes the MIME type to be lost.When you open that email in the Gmail app, the Preview button is no longer there.  It seems that when an attachment doesn’t have a MIME type specified, the Gmail app doesn’t let you do *anything* with.  Not view it, not even save it to the sdcard, which is just ridiculous. That really needs to be fixed.

Of course, what Android really needs is a way to define custom filename extension to MIME type mappings.  Then this whole issue would go away.  But as far as I can tell, there’s no way to do that.

Here’s another case that doesn’t work: view the email in the Browser using the Gmail web interface.  The URL it provides to download the attachment doesn’t include the attachment name, nor is the MIME type specified.  Hence, you can’t open it in my app.


The same thing will happen if you expect to use file browser on the market to open a file with extension/MIME type defined by yourself. The detail is in this post: http://stackoverflow.com/questions/8212027/datafiletype-custom-wont-open-im-my-app