Click to See Complete Forum and Search --> : mime-type


artemis
09-16-2007, 03:23 PM
How do you get the mime-type of a file?
I basically want to check that the file is editable as in .html/.txt/.php etc and not and image or .exe,.ico etc, any ideas?

NogDog
09-16-2007, 03:37 PM
You can use the auto_detect() method (http://pear.php.net/manual/en/package.tools.mime-type.detecting.php) of the PEAR MIME_type package (http://pear.php.net/manual/en/package.tools.mime-type.php).

flann
09-16-2007, 03:40 PM
you might also try is_writable() http://us3.php.net/manual/en/function.is-writable.php

artemis
09-16-2007, 04:04 PM
Cool, thanks guys!