Bug #57859 [Opn->Fbk]: finfo_file will not return mime-type
| From: | cmb@php.net | Date: | Tue, 03 Nov 2020 16:28:22 +0000 |
| Subject: | Bug #57859 [Opn->Fbk]: finfo_file will not return mime-type | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230087@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=57859&edit=1
ID: 57859
Updated by: cmb@php.net
Reported by: online at patrick-brueckner dot de
Summary: finfo_file will not return mime-type
-Status: Open
+Status: Feedback
Type: Bug
-Package: Fileinfo
+Package: Unknown/Other Function
Operating System: Linux 2.6.20 / Ubuntu 7.04
PHP Version: 5.2.1
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Does that still happen with any of the actively supported PHP
versions[1]? If so, please provide the file which triggers the
unexpected behavior for download.
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2008-01-23 10:24:14] 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.
------------------------------------------------------------------------
[2007-10-02 05:19:52] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=57859&edit=1