get_mimetype ( $ext )

Attempt to match the file extension to a known mime-type.

Access

public static

Parameters

Parameter

Type

Required

Description

$ext

string

Required

The file extension to attempt to map.

Returns

Type

Description

string

The mime-type to use for the file extension.

Related Methods

Source

Method defined in utilities/mimetypes.class.php | Toggle source view (5 lines) | View on GitHub

public static function get_mimetype($ext)
{
    $ext = strtolower($ext);  // Make sure the passed in extension is lowercase
    return isset(self::$mime_types[$ext]) ? self::$mime_types[$ext] : 'application/octet-stream';
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback