php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57859 finfo_file will not return mime-type
Submitted: 2007-10-02 05:19 UTC Modified: -
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: online at patrick-brueckner dot de Assigned:
Status: Open Package: Fileinfo (PECL)
PHP Version: 5.2.1 OS: Linux 2.6.20 / Ubuntu 7.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: online at patrick-brueckner dot de
New email:
PHP Version: OS:

 

 [2007-10-02 05:19 UTC] online at patrick-brueckner dot de
Description:
------------
The below code does not return a mimetype string but an identify-like output.

Reproduce code:
---------------
<?php
$oFinfo = finfo_open(FILEINFO_MIME);
echo finfo_file($oFinfo,"/home/paddy/Firefox_wallpaper.png");
?>

Expected result:
----------------
image/png

Actual result:
--------------
PNG image data, 400 x 264, 8-bit/color RGB, non-interlaced

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-23 10:24 UTC] php at kingsquare dot nl
A possible answer to this bug lies in the inability to load a non standard mime.magic file.
(see bug #9798)

the problem below can be fixed using this (and only this) extra paramter in the finfo_open() call:
finfo_open(FILEINFO_MIME, '/usr/share/file/magic');

BUT, copying the magic file OR using a different file will not work:
finfo_open(FILEINFO_MIME, '/some/other/location');

on Debian (or Ubuntu) systems the default magic file (which ever that may be) is apperntly not used nor is a error given about not being able to open the magic database.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC