6.0.0-beta1
8/12/25

[#325] MIME types of uploaded attachment files
Summary MIME types of uploaded attachment files
Queue IMP
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners Horde Developers (at)
Requester gereke (at) thomasgereke (dot) de
Created 06/22/2004 (7721 days ago)
Due
Updated 11/20/2004 (7570 days ago)
Assigned 07/12/2004 (7701 days ago)
Resolved 11/20/2004 (7570 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
11/20/2004 01:07:07 AM Jan Schneider Comment #9
State ⇒ Resolved
Reply to this comment
Implemented by Michael.
11/17/2004 10:39:48 AM Jan Schneider Comment #8 Reply to this comment
Yes, a text/* viewer sounds good.
11/17/2004 08:39:40 AM Michael Slusarz Comment #7 Reply to this comment
I can confirm that fileinfo will add the 'charset' information for 
text parts.  I have added code to strip this from the output.



As far as identifying the file as 'text/x-c' rather than 'text/plain', 
IMHO this is actually *exactly* why magic is better than file 
extension checking.  This really is a C file, not a text/plain file, 
and the fact that IMP has not been configured to handle text/x-c 
should not alter this decision.



Just wondering if maybe we should add a text/* viewer in horde that 
will do a simple display of a text file in the event that no specific 
text/foo entry matches.
11/15/2004 07:55:51 PM Chuck Hagenbuch Comment #6 Reply to this comment
I can install fileinfo, but I can't get it to recognize my magic 
database, so no, I can't reproduce it.
11/15/2004 03:42:18 PM Jan Schneider Comment #5
Assigned to Horde DevelopersHorde Developers
Taken from Jan Schneider
Reply to this comment
I still wasn't able to install fileinfo from PECL. Is someone else 
able to reproduce this?
07/12/2004 11:14:23 AM Jan Schneider Assigned to Jan Schneider
Priority ⇒ 1. Low
State ⇒ Assigned
 
07/12/2004 09:36:50 AM   Comment #4
New Attachment: junixsocket.c Download
Reply to this comment
When I compose a new mail, and attach this file, the file is listed 
with "(text/x-c; charset=us-ascii)" (in the compose window). When 
pressing preview a new browser window opens, but then the save as 
dialog appears.



That's the same what file -i returns.



When the message returns (send to myself) the mime type changed to 
"text/x-c" which is also not recognized by enscript by default.



When I skip fileinfo support in Horde/MIME/Magic.php the display of c 
files is ok.


07/12/2004 09:36:49 AM gereke (at) thomasgereke (dot) de Comment #3 Reply to this comment
When I compose a new mail, and attach this file, the file is listed 
with "(text/x-c; charset=us-ascii)" (in the compose window). When 
pressing preview a new browser window opens, but then the save as 
dialog appears.



That's the same what file -i returns.



When the message returns (send to myself) the mime type changed to 
"text/x-c" which is also not recognized by enscript by default.



When I skip fileinfo support in Horde/MIME/Magic.php the display of c 
files is ok.


07/12/2004 09:12:27 AM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Can you upload an example attachment that causes the behaviour 
described in 2? I can't reproduce this.
06/22/2004 07:51:14 PM gereke (at) thomasgereke (dot) de Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Queue ⇒ IMP
State ⇒ Unconfirmed
Reply to this comment
1.

It seems that MIME types of attachments are first taken from the 
client. This is not optimal I think: with Firefox the MIME type 
changes after downloading files with wrong types. Example: download 
PDF file with MIME type 'x-application/octetstream'. Upload another 
PDF file as attachment to Imp. Its MIME type will be 
'x-application/octetstream'. So it cannot be displayed like a PDF.



2.

The fileinfo output is preferred over the mapping by extension when 
searching for MIME types. This may be ok - but fileinfo returns MIME 
types which are unexpected to Imp/Horde. For example: c files are 
returned as 'text/x-c; charset: us-ascii'. The MIME handlers do not 
cut the charset prefix, so the file isn't displayed by preview with 
enscript but offered to download.

I think on text files, it will be preferrable to take the file 
extension instead of the fileinfo answer as this is not accurate anyway.



I'm using

     * Horde: 3.0-cvs

     * Imp: 4.0-cvs

     * Ingo: 1.0-cvs

     * Turba: 2.0-cvs

from 06/16/2004.

And

   PHP Version 4.3.7

   Apache/2.0.49

   pecl fileinfo 0.2

   file 4.09


Saved Queries