public/js/kcfinder/lib/helper_file.php
static function getMimeType($filename, $magic=null) {
        if (class_exists("finfo")) {
            $finfo = new \finfo(FILEINFO_MIME, $magic);
            if ($finfo) {
                $mime = $finfo->file($filename);
                $mime = substr($mime, 0, strrpos($mime, ";"));
                return $mime;
            }
        }
        $ext = self::getExtension($filename, true);
        return isset(self::$MIME[$ext]) ? self::$MIME[$ext] : "application/octet-stream";
    }
static function getMimeType($filename, $magic=null) {
        if (class_exists("finfo")) {
            $finfo = new \finfo(FILEINFO_MIME, $magic);
            if ($finfo) {
                $mime = $finfo->file($filename);
                $mime = substr($mime, 0, strrpos($mime, ";"));
                return $mime;
            }
        }
        $ext = self::getExtension($filename, true);
        return isset(self::$MIME[$ext]) ? self::$MIME[$ext] : "application/octet-stream";
    }
Get MIME type of the given filename. If Fileinfo PHP extension is
available the MIME type will be fetched by the file's content. The
second parameter is optional and defines the magic file path. If you
skip it, the default one will be loaded.
If Fileinfo PHP extension is not available the MIME type will be fetched
by filename extension regarding $MIME property. If the file extension
does not exist there, returned type will be application/octet-stream
@param string $filename
@param string $magic
@return string