Bug 618713 - attachment type autodetection does not work for some files
attachment type autodetection does not work for some files
Status: CLOSED UPSTREAM
Product: Bugzilla
Classification: Community
Component: Attachments/Requests (Show other bugs)
3.6
All Linux
medium Severity medium (vote)
: ---
: ---
Assigned To: Simon Green
: Reopened
: 555677 573036 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-27 11:07 EDT by Jiri Pirko
Modified: 2015-05-04 21:20 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-07-03 18:58:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
example attachment (52.34 KB, application/octet-stream)
2012-05-21 03:27 EDT, Matěj Cepl
no flags Details

  None (edit)
Description Jiri Pirko 2010-07-27 11:07:25 EDT
Description of problem:

When I attach for example file.log of file.patch and I leave option autodetect selected, the attachment type is always "application/octet-stream".

Version-Release number of selected component (if applicable):
3.4.7+

How reproducible:
always

Steps to Reproduce:
1. attach file.patch and select "autodetect type"
2. observe the attachment type
  
Actual results:
application/octet-stream

Expected results:
text/plain (with patch checkbox checked)
Comment 1 David Lawrence 2010-08-25 17:40:35 EDT
Red Hat has now upgraded to Bugzilla 3.6 and this bug will now be reassigned to that version. It would be helpful to the Bugzilla Development Team if this bug is verified to still be an issue with the latest version. If it is no longer an issue, then feel free to close, otherwise please comment that it is still a problem and we will try to address the issue as soon as we can.

Thanks
Bugzilla Development Team
Comment 2 Frédéric Buclin 2011-02-20 05:15:41 EST
Note that the MIME type is set by your web browser, not by Bugzilla itself.
Comment 3 Matěj Cepl 2012-05-21 03:27:11 EDT
Created attachment 585752 [details]
example attachment

(In reply to comment #2)
> Note that the MIME type is set by your web browser, not by Bugzilla itself.

What??? So after six years inability to fix this well known bug, you started to blame browser?

Steps to reproduction:
1. Take a plain text file (like the attached one)
2. Leave the MIME type to "auto-detect"
3. Click Submit.

Observed result:
for at least 8 times out of 10 the MIME type is set to application/octet-stream (which means I cannot read the attachment in browser, but it downloads)

Expected result:
it should be set to text/* (and ALL text/* should be opened in browser, but that's another bug)
Comment 4 Matěj Cepl 2012-05-21 03:32:08 EDT
(In reply to bug 555677 comment 5)
> The MIME type is set by your web browser, not by Bugzilla itself. This means
> that your browser didn't detect your file as text/plain, but as text/x-log.

When I open this file in browser from file:///tmp/Xorg.0.log and press Ctrl-I it says the file is text/plain.
Comment 5 Simon Green 2012-05-21 04:24:01 EDT
*** Bug 573036 has been marked as a duplicate of this bug. ***
Comment 6 Simon Green 2012-05-21 04:24:24 EDT
*** Bug 555677 has been marked as a duplicate of this bug. ***
Comment 7 Frédéric Buclin 2012-05-21 11:13:02 EDT
(In reply to comment #3)
> What??? So after six years inability to fix this well known bug, you started
> to blame browser?

I blame the one which sets the MIME type, which is your browser, yes. If you want Bugzilla to correctly fix the MIME type itself, you should use the typesniffer extension, see http://bzr.mozilla.org/bugzilla/extensions/typesniffer/trunk/files.
Comment 8 Matěj Cepl 2012-05-22 00:38:01 EDT
(In reply to comment #7)
> I blame the one which sets the MIME type, which is your browser, yes. If you
> want Bugzilla to correctly fix the MIME type itself, you should use the
> typesniffer extension, see
> http://bzr.mozilla.org/bugzilla/extensions/typesniffer/trunk/files.

*I* should? These are bugzilla extensions, aren't they? So we should use them on bugzilla.r.c instance, shouldn't we?
Comment 9 John W. Linville 2012-05-22 11:05:15 EDT
Please do something about this at the _bugzilla_ end -- I'm not worried about setting the MIME type for the files I _upload_.  I'm trying to avoid having to manually change the MIME type for every attachment I want to view that someone _else_ uploaded...
Comment 10 Simon Green 2012-07-03 18:58:10 EDT
We'll inherit the change when we migrate to Bugzilla 4.4

Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/Attachment.pm
modified Bugzilla/Install/Requirements.pm
modified template/en/default/setup/strings.txt.pl
Committed revision 8284.

Note You need to log in before you can comment on or make changes to this bug.