Is there any available, "independent" function which could replace mime_content_type()?
On my new hosting I'm getting error:
Fatal error: Call to undefined function mime_content_type() in download.php on line 3
finfo_file doesn't work as well...
Is there any available, "independent" function which could replace mime_content_type()?
On my new hosting I'm getting error:
Fatal error: Call to undefined function mime_content_type() in download.php on line 3
finfo_file doesn't work as well...
Just mimic the function in your compat.php if you have one
if(!function_exists("mime_content_type"))
{
function mime_content_type($file)
{
$open_bit = finfo_open(FILEINFO_MIME_TYPE);
return finfo_file($open_bit, $file);
}
}
The above function (FileInfo
) is a PECL extension and is encouraged by PHP To use as an alternative, if you do not have the extension installed you can do the following:
http://pecl.php.net/get/Fileinfo-X.X.X.tgz
extension=fileinfo.so
to your php.iniAs a matter of fact, there are two indepent implementations. One in http://upgradephp.berlios.de/ and one in PHP_Compat. You need the mime-magic
file in either case.