Handling of incorrect MIME types

Discussion of features in Mozilla Firefox
Post Reply
Dunderklumpen
Posts: 16224
Joined: March 9th, 2003, 8:12 am

Post by Dunderklumpen »

scratch wrote:
Dunderklumpen wrote:If a file is being sent out as plain text, has characters in it that says that it most likely is not a text file - would it be possible to check the extension of the filename (.rar, .wba etc. etc.) and then let the user decide what to do with it?

I think that´s what "another" browser is doing....


nope, the other browser determines type for all things, not just binary things. so, for example, if you have an html doc sent out as text/plain, IE still displays it as HTML. with this behavior, it would be displayed as plain text still. I think that if anything is going to be done, it should just pop up a dialog saying it claims to be plaintext but seems to actually be binary, so the server is probably misconfigured. then it could allow the user to either view it as text or save it.


Ok, that would also work and it sounds as a good workaround. Thanks for the info on "the other browser" :-)
skyisgrey
Posts: 82
Joined: June 2nd, 2003, 4:44 pm

Post by skyisgrey »

Would it be anti-standards to just treat a text/plain file just like all the other files that give you a dialogue with the option to view in the associated program or to download it?

That way users can choose to download it and add the correct extension so it saves correctly, or if it is actually a text file the user could choose to open it in gedit or Notepad or whatever is the default text editor.

Showing the dialogue only when binary data is detected would be against standards, but showing it all the time probably wouldn't.
User avatar
scratch
Posts: 4942
Joined: November 6th, 2002, 1:27 am
Location: Massachusetts

Post by scratch »

skyisgrey wrote:Would it be anti-standards to just treat a text/plain file just like all the other files that give you a dialogue with the option to view in the associated program or to download it?

That way users can choose to download it and add the correct extension so it saves correctly, or if it is actually a text file the user could choose to open it in gedit or Notepad or whatever is the default text editor.

Showing the dialogue only when binary data is detected would be against standards, but showing it all the time probably wouldn't.


What if i want actual text files to open in the browser window? Because I do.
skyisgrey
Posts: 82
Joined: June 2nd, 2003, 4:44 pm

Post by skyisgrey »

Sure, that could be an option in the dialogue too.
User avatar
danieljackson
Posts: 83
Joined: July 22nd, 2003, 4:03 pm
Location: UK

Post by danieljackson »

I'm sure there's nothing in the standards against asking the user to confirm something.

Wouldn't this mechanism also need to check for a "Unicode header"? (e.g. for text files in UTF-16 format) -- so that it didn't think these files were binary.

I suppose a better range to check for would be guessing "binary" for any bytes of values 0-8 or 14-31.

If it wasn't clear, the "Text appears to be binary data" dialog should remember your choice of:
  • Save file
  • View in browser
  • Open with application X (registered as handling the extension and/or the MIME-type determined from the extension in an OS-specific manner)
...for each extension. e.g. I'd always 'Save file' for .RAR files, and 'Open with application' for something like a .PDF.

If it did this you'd need a way to reset it in the options (or 'manage' it, but that could be fiddley)
TychoQuad
Posts: 1263
Joined: December 11th, 2002, 12:30 am
Location: Australia

Post by TychoQuad »

We have all talk and no action here. Will someone who is adept at making plugins please produce some workable solution that we can argue about? I wouldn't even mind a banner like junk mail gets in Thunderbird asking you to save.

Anyway, prototype, then argue about changes/implimentation.
User avatar
alanjstr
Moderator
Posts: 9100
Joined: November 5th, 2002, 4:43 pm
Location: Anywhere but here
Contact:

Post by alanjstr »

Someone did, over in the Extensions forum. Unfortunately, the hooks that are needed into the core don't allow for it to be very fast.
Former UMO Admin, Former MozillaZine General Mod
I am rarely on mozillaZine, so please do not send me a private message.
My Old Firefox config files
TychoQuad
Posts: 1263
Joined: December 11th, 2002, 12:30 am
Location: Australia

Post by TychoQuad »

That's why i said workable solution, and it wasn't perfect either. Someone reported it didn't pick up their link, and it wouldn't even process mine, either that, or it's still trying.

I've read this thread from top to bottom, and it's just the same people throwing around the same arguments, or different people throwing around the same arguments. You could probably condence this whole thread into 2 pages of original posts.

Everyone seems to have an opinion, and while i'm for some sort of MIME type guessing, I'm not going to argue this fact with anyone, simply because without a extension or patch which does something about it, the whole argument is moot.
User avatar
Paradox52525
Posts: 1219
Joined: April 23rd, 2003, 9:13 am
Location: Middle of nowhere
Contact:

Post by Paradox52525 »

Yeah, I was talking about the Mimetype magic extension before, it seems to be completely broken ATM, it won't even process links entered into its textbox. Additionally it was a text extension, I think it only processed links you specifically entered into its testbox in options. It was never implemented.
SuperJeff
Posts: 62
Joined: May 17th, 2003, 4:23 pm

Post by SuperJeff »

scratch wrote:
skyisgrey wrote:Would it be anti-standards to just treat a text/plain file just like all the other files that give you a dialogue with the option to view in the associated program or to download it?

That way users can choose to download it and add the correct extension so it saves correctly, or if it is actually a text file the user could choose to open it in gedit or Notepad or whatever is the default text editor.

Showing the dialogue only when binary data is detected would be against standards, but showing it all the time probably wouldn't.


What if i want actual text files to open in the browser window? Because I do.


Well you could associate it with Firebird maybe? But it would have to be done right so that firebird doesnt just keep asking you what to do with it. But I agree the warning dialog is the best way, with an option to save it, or view it in firebird, and maybe also an option to open it with the associated program based on the extension.
User avatar
Atreyu
Posts: 37
Joined: November 18th, 2002, 3:35 pm
Location: Adelaide, AU
Contact:

Post by Atreyu »

As much as I love the fact that FB does support and stick to standards etc ... Opera has done a damn good job with standards compliance also - yet Opera has a standard option to:
Opera Preferences wrote:
  • Determin Action by MIME type
  • Determin Action by Extension if MIME type is unreliable


Anyone who uses Yahoo groups would be familiar with MIME types being unreliable ... I don't want opera opening a default application just to view some image ... i want it to open that image in the same window.
User avatar
jrobbio
Posts: 713
Joined: June 28th, 2003, 12:40 pm
Location: Loughborough, England
Contact:

Post by jrobbio »

As long as I don't start getting pdf files appearing in my browser screen causing all sorts of havoc then I'm happy, even if I've just completely speeded it up with this http://forums.mozillazine.org/viewtopic.php?t=20055

I agree with TychoQuad that we could probably reduce this to 2 pages of issues, but everyone has an opinion because it BOTHERS them so much.

Take it from Jakob Nielsen, user choice is a good thing!
Official Win32 BitTorrent 0.7: here
BT Tracker
- Get the latest Fire/Thunderbird builds
User avatar
jmn
Posts: 330
Joined: August 3rd, 2003, 4:30 pm
Location: London, UK

Post by jmn »

danieljackson wrote:I'm sure there's nothing in the standards against asking the user to confirm something.

Wouldn't this mechanism also need to check for a "Unicode header"? (e.g. for text files in UTF-16 format) -- so that it didn't think these files were binary.

I suppose a better range to check for would be guessing "binary" for any bytes of values 0-8 or 14-31.

If it wasn't clear, the "Text appears to be binary data" dialog should remember your choice of:
  • Save file
  • View in browser
  • Open with application X (registered as handling the extension and/or the MIME-type determined from the extension in an OS-specific manner)
...for each extension. e.g. I'd always 'Save file' for .RAR files, and 'Open with application' for something like a .PDF.

If it did this you'd need a way to reset it in the options (or 'manage' it, but that could be fiddley)


You are right about the misreading of Unicode text files. That is something that will need to be handled simply and accurately and this will also need to work with XML. There are also CTL issues which are still under development in Mozilla which will eventually need to be integrated into Firebird.

Has there been any decision on where the development team are going with the mimetype issues or are things still up in the air ?

J.M.N.
London
User avatar
jrobbio
Posts: 713
Joined: June 28th, 2003, 12:40 pm
Location: Loughborough, England
Contact:

Post by jrobbio »

I knew there was something else that should have been put in the 0.7 thread! This is the biggest bug of them all and I forgot about it.

Rob
Official Win32 BitTorrent 0.7: here
BT Tracker
- Get the latest Fire/Thunderbird builds
User avatar
jmn
Posts: 330
Joined: August 3rd, 2003, 4:30 pm
Location: London, UK

Post by jmn »

jrobbio wrote:I knew there was something else that should have been put in the 0.7 thread! This is the biggest bug of them all and I forgot about it.

Rob

What bug ?

I thought it was supposed to be a feature ... :-)

J.M.N.
London
Post Reply