MIME Types and CUPS Filters
CUPS reads the file /etc/cups/mime.types (and all other files carrying a
*.types suffix in the same directory) upon startup. These files contain the MIME type
recognition rules that are applied when CUPS runs its autotyping routines. The rule syntax is explained in the
man page for mime.types and in the comments section of the
mime.types file itself. A simple rule reads like this:
application/pdf pdf string(0,%PDF)
This means if a filename has a .pdf suffix or if the magic string
%PDF
is right at the beginning of the file itself (offset 0 from the start), then it is a
PDF file (
application/pdf
). Another rule is this:
application/postscript ai eps ps string(0,%!) string(0,<04>%!)
If the filename has one of the suffixes .ai , .eps ,
.ps , or if the file itself starts with one of the strings
%!
or
<04>%!
, it is a generic PostScript file
(
application/postscript
).
|