FileDataSource doesn't know about many mime types and seems to make most attachments application/octet-stream. How can I extend its mime type set?

John Zukowski

You can add support for more extensions programmatically or by adding a META-INF/mime.types configuration file to your application.

For example, to map the .doc extension to the MIME type application/msword, create a META-INF/mime.types file with the single line:

application/msword doc

The MimetypesFileTypeMap class javadocs contains additional details.

About | Sitemap | Contact