Mime-types

When a client requests a file from a web server, the web server needs to inform the client of the format of the returned data, eg. whether it is a piece of text, some html, a jpeg or whatever. This information determines what the client browser decides to do with the data being downloaded.

This is done by sending what is called a mime-type to the client as part of the response. The mime-type contains describes the format of the information being returned. An example mime-type for a jpeg format picture file is image/jpeg, for a html file is would be text/html and a Microsoft avi format movie would be video/x-msvideo.

Zeus Server determines what mime-type to classify each request as by looking at the file extension of the resource being requested. For example, if the client request was for http://www.zeus.co.uk/logo.gif, then gif is the extension that is used. This extension is then looked up in a mime-types file which contains mappings from file extensions to mime-types, in this case image/gif would be found.

Format of a mime-types file

The file is a plain text file, which contains lines of the following form:

[mime-type][wsp][extensions]

where:
[mime-type] is the mime-type describing the resource, eg. video/mpeg
[wsp] is white-space, (one or more tab/space characters)
[extensions] is of the form [null] | ([extension][wsp])*[extension]
[null] means no data (ie. mime-type not used)
[extension] is the file extension which maps to this mime-type, eg jpeg

Some examples

text/plain        txt
This will make the server return a mime-type of text/plain for any requests to files ending in `.txt', eg. readme.txt.
video/mpeg        mpeg mpg mpe
This will use a mime-type of video/mpeg for any files ending in `.mpeg', `.mpg' and `.mpe'.
Back to the features index