Re: mime types

sfahey@niu.edu
Thu, 22 Jan 98 15:32:17 -0600

In <Pine.3.89.9801221520.C24856-0100000@nirvana>, on 01/22/98
at 03:29 PM, John McAnally <a10jmm1@nirvana.acs.niu.edu> said:

>Q1: "My web server doesn't support the use of the 'htm' extension, how do
>I rename all of my files with the 'html' extension?"

>A1: If you add 'htm' to the list of supported content types (content type
>is denoted by file extension), then you won't have to rename the files.
>If you have a 'mime.types' file:

>Change the line:
>type=text/html exts=html

>to look like:
>type=text/html exts=html,htm

>The file may not be called "mime.types" on your web server, but somewhere
> in your server's config files there is a file that specifies what sort
>of "Content Types" it allows. (I will admit to actually helping people
>change their file extensions, before I knew about this. In fact, I even
>wrote a Unix shell script to automate the conversion...)

You might also consider setting the default to octet-stream. In Apache this
is done using the "DefaultType octet-stream" directive. If the server can't
figure out what kind of file it is sending it will default to this type.

This also solves many of the problems in the next question.

>Q2: "I want to put a non-html file out on my web server but I don't want
>the web browser to display the file (and then make the user go to "file",
>then "save as", but rather to automatically bring up the "SAVE AS" screen
>for the user to download the file instead."

>A2: Find or create a mime type for an extension to download. You want the
>type to be "application/octet-stream" or the browser will probably try to
>display the file. The extension could be one of the already existing
>ones (like '.bin' or '.exe'). These are also recognized by Netscape
>("Options", "General Preferences", "Helpers") as file extensions that it
>will try to save by default. If Netscape doesn't recognize a file
>extension and the server doesn't tell it otherwise, it will display the
>file as plain text. So, you just can't make up your own file extensions
>for downloading without putting them in the web server's mime.types file
>(or you could add your extension to everyone's browser :-)) I have seen
>some webmasters use extensions like '.savme'. (Is there a conventional
>way of doing this?)

>For those of you using corn for your web publishing needs... I've
>attached a copy of the mime.types file used on corn (as it stands today).

How about java and javascript? I'm not sure but I think they are:

type=text/plain exts=java
type=application/x-javascript exts=js

Sean