Simple library to guess the mime-type from the extension of a file. As various applications need to do this type ofinferencing it seems worthwhile to place this functionality in an extensible library.
default_mimetype
. To change the default, use e.g.,
:- set_prolog_flag(default_mimetype, text/plain).
The initial default mime-type is application/unknown
. Use
the value -
to denote there is no default.
ContentType:
ContentType. It
takes the following steps:
default_charset
The 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
.The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
ContentType:
ContentType. It
takes the following steps:
default_charset
The 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
.