Bug #57859 [Fbk->NoF]: finfo_file will not return mime-type

From: Date: Sun, 15 Nov 2020 04:22:08 +0000
Subject: Bug #57859 [Fbk->NoF]: finfo_file will not return mime-type
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230359@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: php-bugs@lists.php.net Reported by: online at patrick-brueckner dot de Summary: finfo_file will not return mime-type -Status: Feedback +Status: No Feedback Type: Bug Package: Unknown/Other Function Operating System: Linux 2.6.20 / Ubuntu 7.04 PHP Version: 5.2.1 Assigned To: cmb Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2020-11-03 16:28:22] cmb@php.net 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> ------------------------------------------------------------------------ [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

« previous php.bugs (#230359) next »