You are here

function file_get_type in D7 Media 7

Determines the file type of a passed in file object.

1 call to file_get_type()
file_entity_file_presave in file_entity/file_entity.module
Implements hook_file_presave().

File

file_entity/file_entity.file_api.inc, line 62
API extensions of Drupal core's file.inc.

Code

function file_get_type($file) {
  foreach (file_info_file_types() as $type => $info) {
    if (isset($info['claim callback']) && ($function = $info['claim callback']) && function_exists($function) && $function($file, $type)) {
      return $type;
    }
  }
}