ePages 6.11.0 - DE_EPAGES/Core/API/MimeTypes.pm

Package DE_EPAGES::Core::API::MimeTypes

Methods for returning the mimetype by various input

@EXPORT_OK
GetMimeTypeByExtension
GetMimeTypeByFileName

Functions

GetMimeTypeByExtension
GetMimeTypeByFileName

GetMimeTypeByExtension

Returns the mimetype for a given extension. The extension is not case- sensitive and can have a leading dot (for compatibility with fsplit and some others).

Syntax
my $MimeType = GetMimeTypeByExtension( $Extension);
Example
GetMimeTypeByExtension('mp3'); # audio/mpeg
Input
$Extension (string)
Return
$MimeType (string or undef)
The mimetype for this extension

GetMimeTypeByFileName

Returns the mimetype for a given file name. The extension is not case- sensitive.

Syntax
my $MimeType = GetMimeTypeByFileName( $FileName );
Example
GetMimeTypeByExtension('/some/path/to/my/file.mp3'); # audio/mpeg
Input
$FileName (string)
file name (relative or absolute)
Return
$MimeType (string or undef)
The mimetype for this file name