public function Mimetypes::fromFilename

Get a mimetype from a filename

Parameters

string $filename Filename to generate a mimetype from:

Return value

string|null

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Mimetypes.php, line 960

Class

Mimetypes
Provides mappings of file extensions to mimetypes @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types

Namespace

Guzzle\Http

Code

public function fromFilename($filename) {
  return $this
    ->fromExtension(pathinfo($filename, PATHINFO_EXTENSION));
}