I use an Apache server to make available J2ME application files (namely a *.jad file and a *.jar archive).

Now I know that to properly serve these files you need to tell Apache what their MIME type is. I also know that you can do this via .htaccess files, Directory directive in Apache configuration files or in /etc/mimes.types with the following commands:

  • [AddType] text/vnd.sun.j2me.app-descriptor jad
  • [AddType] application/java-archive jar

I used all these ways but I still can't download the jad file with a mobile phone, instead it is displayed as a text file.

Now my question is : is it possible to know which MIME type is used when a file is downloaded ?

Therefore I am looking for a diagnosis tool (preferably serverside) that can tell me in details what happens for each file served by Apache.

Thank you very much for your help.


is it possible to know which MIME type is used when a file is downloaded

This should be the value of the Content-Type HTTP Header.

It should be possible to modify your Apache LogFormat line to include the value of the Content-Type Header. %{Content-Type}o.

If you are not serving content over HTTPS, then you could install and use wireshark. This probably wouldn't be as useful if you want to collect this for many requests over time.

Many browsers and http clients will give you this information. Check out liveheaders on firefox. Both wget and curl include verbose modes that will display the content-type and other headers.

  • Great, I did not know so many details could be added to custom logs. Thanks a lot, it worked perfectly. – Aabaz Nov 8 '11 at 7:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.