Closed Bug 86397 Opened 24 years ago Closed 23 years ago

Add autosense to attachment (mime-type)

Categories

(Bugzilla :: Attachments & Requests, defect, P2)

2.13
x86
Windows 2000
defect

Tracking

()

VERIFIED FIXED
Bugzilla 2.16

People

(Reporter: bugzilla, Assigned: myk)

References

Details

Having to specify the attachment type semse like a waste of time. Why cant bugzilla just autosense the attachment type. When a browser uploads a file the "Content-Type" is automaticlly send along with the file ala: Content-Type = image/gif You can try it at: http://gemal.dk/browserspy/upload.html And if bugzilla doesn't recieve any contenttype we just ask for it.
yeah, this would solve a lot of problems, wouldn't it. :)
Target Milestone: --- → Bugzilla 2.16
Is this really possible? I mean, can we hope to always get the right MIME type? I thought that certain MIME types looked similar. For example, don't C and Java programs each have a MIME type?
Matty, when you upload a file, the user's browser is supposed to supply the mime-type of the file being uploaded. What's being suggested is to just use the mime-type supplied by the browser instead of prompting for one.
I kind of realised that might be the case sometime after I wrote that comment. Assumedly then we're relying on the uploader's OS to determine the type. I'm not totally comfortable with doing this though. An alternative might be to confirm the type after upload and allow an alternative to be easily specified if it's incorrect. This should still make things fairly easily.
Priority: -- → P2
What if no type is supplied? Just ask with a text box?
Perhaps you could just have: ----------- [x] Autosense (automaticlly selects the file type if possible) Choose file type manually: [ ] HTML document [ ] Text document [ ] GIF image [ ] PNG image ------------------ And if autosense fails let show the "chose file type" again...
The point of my comment was to allow the user to confirm autosense, I'm not sure why you'd want to download it. It would mean that you would have an attachment in the DB that wasn't yet attached properly ... you'd need to handle that as well as cleaning it out if it ever got confirmed.
Replace "download" with "override" above. Also above, my second paragraph refers to my previous comments, not Henrik's.
Ok.. In the upload attachment page you could have the following dialog: ----------- [x] Autosense (automaticlly selects the file type if possible) or choose file type manually: [ ] HTML document [ ] Text document [ ] GIF image [ ] PNG image ------------------ So on the resulting page you'll get a: "Bugzilla thinks it's a "HTML document" you just attached. If it isn't please change the type here. Otherwise just surf on... [ ] Text document [ ] GIF Image etc.. or if autosense fails: "Bugzilla coldn't determain the file type. Please specify the file type: [ ] HTML document [ ] Text document [ ] GIF image [ ] PNG image etc...
That makes things very complicated. Firstly, why would we want to not use autosense on the first page? And secondly, since autosense is supposed to work and be correct, it would be rare that you don't agree with it on the resulting page, so a MIME type text box should be adequate. One of the benefits of autosense is we won't have to worry about things like bug #76030 and bug #87976. If we included any list of MIME types these problems would come right back.
I got confused about the last comment. I be happy if we only had the autosense option...
-> Bugzilla product, Changing Bugs component, reassigning.
Assignee: tara → myk
Component: Bugzilla → Creating/Changing Bugs
Product: Webtools → Bugzilla
Summary: Add autosense to attachment → Add autosense to attachment (mime-type)
Version: Bugzilla 2.13 → 2.13
If we use the mime-type sent by the browser, we may run into bug 54940 in mozilla. Just a heads-up.
I don't think bug 54940 is relevant, is it? Anyway, the patch manager makes autosense bugs moot, because you can now edit the MIME type after the initial upload. So, we should just autosense. Gerv
Yes, I was going to say something along those lines. We should say what MIME type was detected though, and allow a click through to edit attachment.
Yes, the screen that says "Attachment XXX created" should say: "MIME type was auto-detected as foo/bar. _Edit_Attachment_". Gerv
Depends on: 98602
I sometimes want to add CSS, JS, HTML, XML etc. known types with text/plain mime type just to show "code", there must be a way to do that. How would the automated thing detects patches? I must say I hate the mime type text box *only* as the alternative method. Do you remember the official JS mime type? The official XUL mime type? What is the correct mime type for XSLT? And so on... I think you should have a drop down list with most common items Mozilla developers are going to face AND a text box. Selecting an entry in the list places the mime type in the text box so you can edit it if you want.
> type just to show "code", there must be a way to do that. I think the UI would be a checkbox marked "patch", and a textbox, default value "<autodetect>". Unless you changed it, it would autodetect, and on the "success" screen, tell you what it chose. If it got it wrong, you could go back and edit the attachment to change it. > I must say I hate the mime type text box *only* as the alternative method. Do > you remember the official JS mime type? The official XUL mime type? Exactly. Your browser knows all these things :-) Gerv
Except when the browser does not know I do not want jump through hoops just to get the mime type I want. I consider running through hoops if at first I must let it autodetect and then go to Edit and then change and submit - if I know application/vnd.heikki-has-registered-a-really-weird-type will never be autodetected I want to be able to set that on the attachment upload page.
That's what the textbox is for :-) It allows you to set the MIME type straight off. Gerv
I think we are going in circles... Let me just draw what I would like to see: Path: <c:\temp\test.xml > [Browse] Description: <testcase > Content Type: * autosense (default) <text/xml > * other * XML (text/xml) <= * XUL (application/x.vnd-mozilla) * ... [Submit] Legend: <edit box> [button] * drop-down list <= selected Selecting "* other" would place string like "content type" in the edit box, selected, and place the focus in the edit box to indicate you need to change it. If you selected autosense and hit submit, it should state what it selected and offer the listbox + edit box to edit. If it could not autosense, there should be a big attention catcher saying autosense failed. The thing that I am after is as few pages as possible. Give me all the power on the first page. After submit, still give me all the power to edit. I am going to be annoyed if I don't have all the power on the first page or if I need to follow a link to edit on the second page.
Hmm, come to think of it I think I would prefer list box for the precanned content types.
Heikki, that proposed UI is quite similar to what Myk's got going over in bug 98602
isn't this one fixed?
Yep. Gerv
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
verified fixed!
Status: RESOLVED → VERIFIED
Component: Creating/Changing Bugs → attachment and request management
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.