You are here

function file_entity_file_get_mimetype_type in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 7.2 file_entity.module \file_entity_file_get_mimetype_type()
5 calls to file_entity_file_get_mimetype_type()
file_entity_field_formatter_view in ./file_entity.field.inc
Implements hook_field_formatter_view().
file_entity_file_formatter_file_image_view in ./file_entity.module
Implements hook_file_formatter_FORMATTER_view().
file_entity_file_update in ./file_entity.file.inc
Implements hook_file_update().
file_entity_metadata_fetch_image_dimensions in ./file_entity.file.inc
Fetch the dimensions of an image and store them in the file metadata array.
_file_entity_update_image_field_dimensions in ./file_entity.file.inc
Update the image dimensions stored in any image fields for a file.

File

./file_entity.module, line 2607
Extends Drupal file entities to be fieldable and viewable.

Code

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