Commit fbbf8381 authored by Richard Mansfield's avatar Richard Mansfield

get_mime_type

parent c27acb31
......@@ -487,6 +487,19 @@ function byteserving_send_file($filename, $mimetype, $ranges) {
}
}
function get_mime_type($file) {
switch (strtolower(PHP_OS)) {
case 'win' :
throw new SystemException('retrieving filetype not supported in windows');
default :
list($output,) = split(';', system(get_config('pathtofile') . ' -ib ' . escapeshellarg($file)));
}
return $output;
}
/**
* Given a path under dataroot, an ID and a size, return the path to a file
* matching all criteria.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment