$_map
$_map : array
The MIME extension map.
Utilities to determine MIME content-types of unknown content.
extToMime(string $ext) : string
Attempt to convert a file extension to a MIME type, based on the global Horde and application specific config files.
If we cannot map the file extension to a specific type, then we fall back to a custom MIME handler 'x-extension/$ext', which can be used as a normal MIME type internally throughout Horde.
string | $ext | The file extension to be mapped to a MIME type. |
The MIME type of the file extension.
filenameToMime(string $filename, boolean $unknown = true) : string
Attempt to convert a filename to a MIME type, based on the global Horde and application specific config files.
string | $filename | The filename to be mapped to a MIME type. |
boolean | $unknown | How should unknown extensions be handled? If true, will return 'x-extension/*' types. If false, will return 'application/octet-stream'. |
The MIME type of the filename.
mimeToExt(string $type) : string
Attempt to convert a MIME type to a file extension, based on the global Horde and application specific config files.
If we cannot map the type to a file extension, we return false.
string | $type | The MIME type to be mapped to a file extension. |
The file extension of the MIME type.
analyzeFile(string $path, string $magic_db = null, array $opts = array()) : mixed
Attempt to determine the MIME type of an unknown file.
string | $path | The path to the file to analyze. |
string | $magic_db | Path to the mime magic database. |
array | $opts | Additional options:
|
The MIME type of the file. Returns false if the file type can not be determined.
analyzeData(string $data, string $magic_db = null, array $opts = array()) : mixed
Attempt to determine the MIME type of an unknown byte stream.
string | $data | The file data to analyze. |
string | $magic_db | Path to the mime magic database. |
array | $opts | Additional options:
|
The MIME type of the file. Returns false if the file type can not be determined.