Skip to content

Commit

Permalink
get mime type
Browse files Browse the repository at this point in the history
  • Loading branch information
alexantr committed Jul 25, 2013
1 parent d39894f commit 0ae0812
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions filemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,11 @@ function get_mime_type($file_path)
elseif (function_exists('mime_content_type')) {
return mime_content_type($file_path);
}
elseif (!stristr(ini_get('disable_functions'), 'shell_exec')) {
$file = escapeshellarg($file_path);
$mime = shell_exec('file -bi ' . $file);
return $mime;
}
else {
return '--';
}
Expand Down

0 comments on commit 0ae0812

Please sign in to comment.