I am frequently asked the following four questions by web publishers.
Since, the answers all involve referring to the mime.types file (your
server may use a different name), it seems a good idea to discuss them
together. I know it seems rather unorthodox to ask and simultaneously
answer my own questions... Please let me know if the answers that I have
been giving out can be improved.
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...)
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?)
Q3: How do I display plain text files.
A3: For this, most web servers have a mime-type of "text/plain" for the
'txt' extension. If its not there, (can't believe it wouldn't be) enter a
line in your mime.types file:
type=text/plain exts=txt
Q4: Application "X" won't "play/view/decode" my audio/video/encoded
file when I click on it.
A4: There isn't a mime type on the web server for that file extension to
tell the browser what kind of application to start-up (and the web
browser doesn't know what to do either). Contact your web master to have
him/her enter it in your web server config files (mime.types).
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).
John M. McAnally
Academic Computing Services
Northern Illinois University
a10jmm1@nirvana.acs.niu.edu
=====================================================================
#--Netscape Communications Corporation MIME Information
# Do not delete the above line. It is used to identify the file type.
type=application/octet-stream exts=bin,exe
type=application/oda exts=oda
type=application/pdf exts=pdf
type=application/postscript exts=ai,eps,ps
type=application/rtf exts=rtf
type=application/toolbook exts=tbk
type=application/x-mif exts=mif
type=application/x-csh exts=csh
type=application/x-dvi exts=dvi
type=application/x-hdf exts=hdf
type=application/x-latex exts=latex
type=application/x-netcdf exts=nc,cdf
type=application/x-sh exts=sh
type=application/x-tcl exts=tcl
type=application/x-tex exts=tex
type=application/x-texinfo exts=texinfo,texi
type=application/x-troff exts=t,tr,roff
type=application/x-troff-man exts=man
type=application/x-troff-me exts=me
type=application/x-troff-ms exts=ms
type=application/x-wais-source exts=src
type=application/zip exts=zip
type=application/x-gtar exts=gtar
type=application/x-shar exts=shar
type=application/x-tar exts=tar
type=application/mac-binhex40 exts=hqx
type=application/midi exts=mid
type=application/x-midi exts=mid
type=application/x-freehand exts=fh3,fh4,fh5,fhc,fh,f7
type=application/x-director exts=dcr,dir,dxr
type=audio/basic exts=au,snd
type=audio/x-aiff exts=aif,aiff,aifc
type=audio/x-wav exts=wav
type=image/gif exts=gif
type=image/ief exts=ief
type=image/jpeg exts=jpeg,jpg,jpe
type=image/tiff exts=tiff,tif
type=image/x-cmu-raster exts=ras
type=image/x-portable-anymap exts=pnm
type=image/x-portable-bitmap exts=pbm
type=image/x-portable-graymap exts=pgm
type=image/x-portable-pixmap exts=ppm
type=image/x-rgb exts=rgb
type=image/x-xbitmap exts=xbm
type=image/x-xpixmap exts=xpm
type=image/x-xwindowdump exts=xwd
type=text/html exts=htm,html
type=text/plain exts=txt
type=text/richtext exts=rtx
type=text/tab-separated-values exts=tsv
type=text/x-setext exts=etx
type=video/mpeg exts=mpeg,mpg,mpe
type=video/quicktime exts=qt,mov
type=video/x-msvideo exts=avi
type=video/x-sgi-movie exts=movie
enc=x-gzip exts=gz
enc=x-compress exts=z
type=magnus-internal/imagemap exts=map
type=magnus-internal/parsed-html exts=shtml
type=magnus-internal/cgi exts=cgi