users@glassfish.java.net

Glassfish mime type setup for unknown file extension.

From: <glassfish_at_javadesktop.org>
Date: Tue, 08 Apr 2008 16:09:38 PDT

Hello. I know how to do a mime type set up for a common file extension like .ppt, .css, .exe etc. http://hobione.wordpress.com/2008/02/12/application-server-mime-type-set-up/
But how would you set up for an uncommon file extension mime type. I have files usually for firmware extension like .cpg (AOS-oldMobile.cpg) or .DBF (AAL_ROC.DBF).

My question is how I can tell GlassFish that if the file extension is not on the domains/domain1/config/default-web.xml, just pop up a Save As instead of spit it out to the browser.

I have tried this, but did not work:

<mime-mapping>
    <extension>*</extension>
    <mime-type>text/plain</mime-type>
  </mime-mapping>

or,
<mime-mapping>
    <extension>cpg</extension>
    <mime-type>text/plain</mime-type>
  </mime-mapping>

Please advise.
Hobi
[Message sent by forum member 'hobione' (hobione)]

http://forums.java.net/jive/thread.jspa?messageID=268259