private function getMimeType($data, $isFilename = false)
    {
        if (extension_loaded('fileinfo')) {
            $finfo = new \finfo(FILEINFO_MIME);
            if ($isFilename !== false) {
                return $finfo->file($data);
            }
            return $finfo->buffer($data);
        }
        return false;
    }
private function getMimeType($data, $isFilename = false)
    {
        if (extension_loaded('fileinfo')) {
            $finfo = new \finfo(FILEINFO_MIME);
            if ($isFilename !== false) {
                return $finfo->file($data);
            }
            return $finfo->buffer($data);
        }
        return false;
    }
private function getMimeType ( $ data , $ isFilename = false ) { if ( extension_loaded ( 'fileinfo' ) ) { $ finfo = new \ finfo ( FILEINFO_MIME ) ; if ( $ isFilename !== false ) { return $ finfo -> file ( $ data ) ; } return $ finfo -> buffer ( $ data ) ; } return false ; }
Get the mime type of downloaded file
If the Fileinfo extension is not loaded, return false
@param string $data File contents as a string or filename
@param string $isFilename Is $data a filename?
@return boolean|string Mime type and encoding of the file
Get the mime type of downloaded file If the Fileinfo extension is not loaded return false