note 62844 added to ref.mime-magic
| From: | Daniel at osu1 dot php dot net | Date: | Fri, 10 Mar 2006 18:02:19 +0000 |
| Subject: | note 62844 added to ref.mime-magic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-105231@lists.php.net to get a copy of this message | ||
this is the example from the pecl module. I found I had to add the full path to the magic file to
get it to work.
<?php
if(!extension_loaded('fileinfo')) {
die("fileinfo extension is not avaliable, please compile it.\n");
}
$path = "/path/to/file";
$res = finfo_open(FILEINFO_MIME,"/usr/share/misc/magic");
$mime_type = finfo_file($res,$path);
echo "mime_type is $mime_type";
?>
----
Server IP: 66.163.161.117
Probable Submitter: 71.143.49.218
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/ref.mime-magic.php
Edit -- http://master.php.net/note/edit/62844
Del: integrated -- http://master.php.net/note/delete/62844/integrated
Del: useless -- http://master.php.net/note/delete/62844/useless
Del: bad code -- http://master.php.net/note/delete/62844/bad+code
Del: spam -- http://master.php.net/note/delete/62844/spam
Del: non-english -- http://master.php.net/note/delete/62844/non-english
Del: in docs -- http://master.php.net/note/delete/62844/in+docs
Del: other reasons-- http://master.php.net/note/delete/62844
Reject -- http://master.php.net/note/reject/62844
Search -- http://master.php.net/manage/user-notes.php