#33829 [Opn->Asn]: mime_content_type() returns text/plain for gzip and bzip files
ID: 33829
Updated by: sniper@php.net
Reported By: mschering at intermesh dot nl
-Status: Open
+Status: Assigned
Bug Type: Filesystem function related
Operating System: Linux (Debian)
PHP Version: 4.3.11
Assigned To: derick
New Comment:
Derick, isn't almost 5 months enough for testing? Just commit the
patch..
Previous Comments:
------------------------------------------------------------------------
[2005-08-01 13:20:36] derick@php.net
Actually, I have a fix for this. Just need to test it a bit more.
------------------------------------------------------------------------
[2005-07-23 01:12:23] sniper@php.net
Please use the fileinfo extension from PECL instead.
(the mime_magic extension has been deprecated)
------------------------------------------------------------------------
[2005-07-22 21:45:09] mschering at intermesh dot nl
Description:
------------
mime_content_type() returns text/plain for gzip and bzip files.
I guess this function looks the type up in /etc/mime.types.
The extensions are not in there and should bot be in there.The comments
in the file say:
Note: Compression schemes like "gzip", "bzip", and "compress" are
notactually "mime-types". They are "encodings" and hence must _not_
have entries in this file to map their extensions. The "mime-type" of
an encoded file refers to the type of data that has been encoded, not
the type of encoding.
My Mail application relies on this function for attaching files from
the filesystem. With this kind of files it failes.
Please fix this.
Reproduce code:
---------------
run mime_content_type on a *.tar.gz file.
Expected result:
----------------
return application/gzip or something like that
Actual result:
--------------
returns text/plain
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33829&edit=1
Thread (6 messages)