when you create a new bug, and click the "Add Attachment" button, the little pop out form does not let you explicitly specify a mime type. after uploading a png image (whose filename ended in ".png"), i noticed the default mime type is set to text/plain. this is probably going to be wrong for most attachments out there.
It's there. You must click the "Show Advanced Fields" link at the top of the page.
true, but most people will be coming in without said advanced options enabled which means we'll be getting (even more) bunches of wrong mime types set which need manual fixing. in previous bugzilla, the advanced stuff was always shown which means the user for the most part would get it right. i'm not advocating turning on the advanced options by default. the default selected option should be "auto-detect" and not "select from list: plain/text". i guess this applies mostly to the enter_bug.cgi step, but could apply to the additional attachment.cgi step after the fact.
The "text/plain" as default came from our bugzilla 2.x patches. So text/plain was "always" default since auto-detect is often worse than text/plain. auto-detect is even browser related IIRC.
(In reply to comment #3) > So text/plain was "always" default since auto-detect is often worse than > text/plain. auto-detect is even browser related IIRC. It's browser-related, yes, but unless your browser is completely stupid, it at least detect all images correctly, and most text/* files.
so where is the auto-detection being done ? my understanding is that the *server* auto detects it and sets the explicit mime type based on the incoming file. so after that, the browser is irrelevant since the server sends that explicit mime type to the browser. or does auto-detect mean the server doesnt specify any mime type at all ? and it lets the browser auto-detect the format ?
The browser passes the file MIME type (Content-Type) as part of the CGI data, and Bugzilla simply gets this information from the browser. In no way is the MIME type guessed by Bugzilla.
Fixed and I also added the typesniffer extension to our Bugzilla, https://bzr.mozilla.org/bugzilla/extensions/typesniffer which hopefully helps "us" to properly detect the file/mime-type if the browser isn't able to do so.