1 file.module file_get_mimetype_type($file)

File

core/modules/file/file.module, line 2005
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

function file_get_mimetype_type($file) {
  if (is_array($file)) {
    $file = (object) $file;
  }
  list($type, $subtype) = explode('/', $file->filemime, 2);
  return $type;
}