Blame doc/help/man-mime.types.html

Packit 2fc92b
Packit 2fc92b
<html>
Packit 2fc92b
Packit 2fc92b
<head>
Packit 2fc92b
	<link rel="stylesheet" type="text/css" href="../cups-printable.css">
Packit 2fc92b
	<title>mime.types(5)</title>
Packit 2fc92b
</head>
Packit 2fc92b
<body>
Packit 2fc92b

mime.types(5)

Packit 2fc92b

Name

Packit 2fc92b
mime.types - mime type description file for cups
Packit 2fc92b

Description

Packit 2fc92b
The mime.types file defines the recognized file types.
Packit 2fc92b

Additional file types are specified in files with the extension .types in the CUPS configuration directory.

Packit 2fc92b

Each line in the mime.types file is a comment, blank, or rule line.

Packit 2fc92b
Comment lines start with the # character.
Packit 2fc92b
Rule lines start with the MIME media type and are optionally followed by a series of file recognition rules:
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
    mime/type [ rule ... rule ]
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
Rules can be extended over multiple lines using the backslash character (\):
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
    mime/type [ really-really-really-long-rule ... \
Packit 2fc92b
      rule ]
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
MIME media types specified by the mime/type field are case-insensitive and are sorted in ascending alphanumeric order for the purposes of matching.
Packit 2fc92b
See the "TYPE MATCHING AND PRIORITY" section for more information.
Packit 2fc92b

The rules may be grouped using parenthesis, joined using "+" for a logical AND, joined using "," or whitespace for a logical OR, and negated using "!".

Packit 2fc92b

Rules

Packit 2fc92b
Rules take two forms - a filename extension by itself and functions with test
Packit 2fc92b
values inside parenthesis.
Packit 2fc92b
The following functions are available:
Packit 2fc92b
Packit 2fc92b
match("pattern")
Packit 2fc92b
True if the filename matches the given shell wildcard pattern.
Packit 2fc92b
ascii(offset,length)
Packit 2fc92b
True if the length bytes starting at offset are valid printable ASCII (CR, NL, TAB, BS, 32-126).
Packit 2fc92b
printable(offset,length)
Packit 2fc92b
True if the length bytes starting at offset are printable 8-bit chars (CR, NL, TAB, BS, 32-126, 128-254).
Packit 2fc92b
priority(number)
Packit 2fc92b
Specifies the relative priority of this MIME media type.
Packit 2fc92b
The default priority is 100.
Packit 2fc92b
Larger values have higher priority while smaller values have lower priority.
Packit 2fc92b
string(offset,"string")
Packit 2fc92b
True if the bytes starting at offset are identical to string.
Packit 2fc92b
istring(offset,"string")
Packit 2fc92b
True if the bytes starting at offset match string without respect to case.
Packit 2fc92b
char(offset,value)
Packit 2fc92b
True if the byte at offset is identical to value.
Packit 2fc92b
short(offset,value)
Packit 2fc92b
True if the 16-bit big-endian integer at offset is identical to value.
Packit 2fc92b
int(offset,value)
Packit 2fc92b
True if the 32-bit big-endian integer at offset is identical to value.
Packit 2fc92b
locale("string")
Packit 2fc92b
True if current locale matches string.
Packit 2fc92b
contains(offset,range,"string")
Packit 2fc92b
True if the bytes starting at offset for range bytes contains string.
Packit 2fc92b
Packit 2fc92b

String Constants

Packit 2fc92b
String constants can be specified inside quotes ("") for strings containing whitespace and angle brackets (<>) for hexadecimal strings.
Packit 2fc92b

Type Matching And Priority

Packit 2fc92b
When CUPS needs to determine the MIME media type of a given file, it checks every MIME media type defined in the .types files.
Packit 2fc92b
When two or more types match a given file, the type chosen will depend on the type name and priority, with higher-priority types being used over lower-priority ones.
Packit 2fc92b
If the types have the same priority, the type names are sorted alphanumerically in ascending order and the first type is chosen.
Packit 2fc92b

For example, if two types "text/bar" and "text/foo" are defined as matching the

Packit 2fc92b
extension "doc", normally the type "text/bar" will be chosen since its name is
Packit 2fc92b
alphanumerically smaller than "text/foo".
Packit 2fc92b
However, if "text/foo" also defines a higher priority than "text/bar", "text/foo" will be chosen instead.
Packit 2fc92b

Files

Packit 2fc92b
/etc/cups - Typical CUPS configuration directory.
Packit 2fc92b

Examples

Packit 2fc92b
Define two MIME media types for raster data, with one being a subset with higher priority:
Packit 2fc92b
Packit 2fc92b
Packit 2fc92b
    application/vnd.cups-raster  string(0,"RaSt") string(0,"tSaR") \
Packit 2fc92b
                                  string(0,"RaS2") string(0,"2SaR") \
Packit 2fc92b
                                  string(0,"RaS3") string(0,"3SaR")
Packit 2fc92b
Packit 2fc92b
    image/pwg-raster              string(0,"RaS2") + \
Packit 2fc92b
                                  string(4,PwgRaster<00>) priority(150)
Packit 2fc92b
Packit 2fc92b

See Also

Packit 2fc92b
cups-files.conf(5),
Packit 2fc92b
cupsd.conf(5),
Packit 2fc92b
cupsd(8),
Packit 2fc92b
cupsfilter(8),
Packit 2fc92b
mime.convs(5),
Packit 2fc92b
CUPS Online Help (http://localhost:631/help)
Packit 2fc92b

Copyright

Packit 2fc92b
Copyright © 2007-2017 by Apple Inc.
Packit 2fc92b
Packit 2fc92b
</body>
Packit 2fc92b
</html>