httpd::mtype(n) 1.1 "Tcl Web Server"
httpd::mtype - Mime types
package require httpd::mtype ?1.1?
The package httpd::mtype provides functionality which
determines the MIME type of a file and related utilities.
The MIME type (e.g., text/html or image/jpeg) is used by
the Document domain to dispatch out to type-specific document
handlers. For example, if there is a procedure named Doc_image/jpeg
then the Document domain will use that procedure to handle
requests for files of that type.
- Mtype path
Determines the MIME type of the file specified by path and
returns it as the result of the command.
- Mtype_ReadTypes file
Set a number of hardwired mappings from file extensions to mime types
first and then reads the specified types file to set up more.
- Mtype_Accept sock
Extract the mime-types favored by the browser making the
current request on the connection sock and returns
them as the result of the command. The result is a list.
- Mtype_Match accept type
Compares the mime type to the list of acceptable types and
return a boolean flag. If true then the type is acceptable.
- Mtype_Add suffix type
Adds a mapping from the file extension suffix
to the mime type to the database maintained by this package
Clears all type mappings stored in the internal database.
files, filesystem, mime, type, web server
Copyright © 2003 Andreas Kupries <email@example.com>