fileinfo help needed

fileinfo help needed

am 23.01.2008 21:48:24 von Bob

I am having trouble getting the PHP PECL fileinfo component to work. I
am using Cakephp 1.2, XAMPP in WIndows Vista environment.

I have the following code:
$file = "C:\xampp\htdocs\app\webroot\pics\file.jpg";

$handle = finfo_open(FILEINFO_MIME,'c:/magic');
if (!$handle) {
echo "Opening fileinfo database failed";
}

$mime_type = finfo_file($handle,$file);

I get the following output:
Opening fileinfo database failed
Warning (2): finfo_file(): supplied argument is not a valid file_info
resource [APP\controllers\users_controller.php, line 198]

I put the magic.mime file in the C:\ directory. I also added the
extension=php_fileinfo.dll line in the php.ini file.

Re: fileinfo help needed

am 23.01.2008 22:05:40 von luiheidsgoeroe

On Wed, 23 Jan 2008 21:48:24 +0100, bob wrote:

> I am having trouble getting the PHP PECL fileinfo component to work. I=

> am using Cakephp 1.2, XAMPP in WIndows Vista environment.
>
> I have the following code:
> $file =3D "C:\xampp\htdocs\app\webroot\pics\file.jpg";
>
> $handle =3D finfo_open(FILEINFO_MIME,'c:/magic');
> if (!$handle) {
> echo "Opening fileinfo database failed";
> }
>
> $mime_type =3D finfo_file($handle,$file);
>
> I get the following output:
> Opening fileinfo database failed
> Warning (2): finfo_file(): supplied argument is not a valid file_info
> resource [APP\controllers\users_controller.php, line 198]
>
> I put the magic.mime file in the C:\ directory. I also added the
> extension=3Dphp_fileinfo.dll line in the php.ini file.

Don't open a new thread. You were given some pointers in your last one. =
=

Did they work (I don't see them in your code)? If not: any other errors =
=

occuring?
-- =

Rik Wasmus