[solved]unable to use php_mime_magic
Posted by: christophe charron (---.w86-216.abo.wanadoo.fr)
Date: August 03, 2007 07:22PM

Hi eveybody.

Is there particular thing to do to use php_mime_extension ?

If I try this script

<?php
$name="./sample/message.eml";
if( file_exists($name) ) {
echo "yes";
/* 1° type d'essai */
$finfo = finfo_open(FILEINFO_MIME,"C:/wamp/php/extras/magic"winking smiley; // Retourne le type mime à la extension mimetype
$mime=finfo_file($finfo, $name);
finfo_close($finfo);
echo $mime;
/* 2° type d'essai */
/*
$o = file_get_contents($name);
$finfo = new finfo(FILEINFO_MIME, 'C:/wamp/php/extras/magic');
echo $finfo->buffer($o);
*/
} else {
echo "nop";
}
?>

i get these error messages :
yes
Warning: finfo_file(): supplied argument is not a valid file_info resource in C:\wamp\moi\graal_travail\exemples_applicatifs\mimeparser-2007-07-20\test\magic_01.php on line 7

Warning: finfo_close(): supplied argument is not a valid file_info resource in C:\wamp\moi\graal_travail\exemples_applicatifs\mimeparser-2007-07-20\test\magic_01.php on line 8

Any idea about it ?

Best regards.



Post Edited (08-03-07 22:57)

--
Cordialement,
Christophe Charron

Options: ReplyQuote
Re: unable to use php_mime_magic
Posted by: christophe charron (---.w86-216.abo.wanadoo.fr)
Date: August 03, 2007 10:56PM

I answer to myself.
In fact, it was not php_mime_magic extension but php_fileinfo. Everything is resumed in this post [pecl.php.net] but it was hard !!



--
Cordialement,
Christophe Charron

Options: ReplyQuote


Sorry, only registered users may post in this forum.