little correction:
<?php
if ( ! function_exists ( 'mime_content_type ' ) )
{
function mime_content_type ( $f )
{
return system ( trim( 'file -bi ' . escapeshellarg ( $f ) ) ) ;
}
}
?>
![]() | mime_content_typeDescriptionstring mime_content_type ( string filename )Returns the MIME content type for a file as determined by using information from the magic.mime file. Content types are returned in MIME format, like text/plain or application/octet-stream.
![]()
sven at frontmedia dot it
06-Mar-2006 04:58
little correction:
webmaster at cafe-clope dot net
23-Feb-2006 09:31
Completing <some dude AT somewhere DOT com> comment:
Y0Gi
26-Jan-2006 03:13
The 'file' utility fortunately is available for Windows, too:
some dude AT somewhere DOT com
08-Oct-2005 12:44
I added these two lines to my magic.mime file:
priyagnair at yahoo dot com
07-Sep-2005 07:40
Quote:
ginnsu at arcee dot ca
09-Mar-2005 02:14
The function mime_content_type only worked for me on Microsoft Windows after I added the directive "mime_magic.debug" to my php.ini with the value of "On". The default value appears to be "Off". Exampe:
Cooljay
08-Nov-2004 10:22
This works on windows too. Make sure to uncomment the following in your php.ini file:
Sven Riedel
10-Jul-2004 09:17
Note that you will need /bin/sh as well as the file(1) program for this function to work. This is relevant when setting apache up in a chroot-environment. Took me a while to find that out.
| ![]() | |