
mimetype.pl -- Determine mime-type for a fileSimple library to guess the mime-type from the extension of a file. As various applications need to do this type of inferencing it seems worthwhile to place this functionality in an extensible library.
file_mime_type(+FileName, -MimeType) is semidet
file_content_type(+File:atom, -ContentType:atom) is det
file_content_type(+File:atom, ?MediaType, -ContentType:atom) is detContentType: ContentType. It
takes the following steps:
default_charsetThe behavior is controlled by several hooks and a flag.
default_charset defines the charset unless it is set
to -. The flag set by default to UTF-8 if the Prolog
flag encoding is set to utf8.