Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

It's not just IE that plays loose like this. Chrome will ignore even the Content-Type header if it can see the content is an audio or video file. For example, upload a .wav to puush and open it in FF and Chrome. FF will show a dump of the bytes interpreted as text because the server sent it with Content-Type: text/plain. Chrome will show an <audio> element.

You can't call either browser broken here. One is doing what the spec says is correct. The other is doing what the user says is correct.



sort by: page size:

If IE chooses to use file extension over MIME type, then it is broken and should be ignored.

Yes, I'm aware that this is probably a workaround for broken web servers, or brain-dead server admins. This workaround should never have been deployed, as it breaks interactions with non-broken web servers.


I've worked on a lot of cross browser bugs since IE5, never seen one created by any header or created by omitting http headers. Honestly your comment is just nonsense.

IE9 is the only browser among safari/chrome/firefox/ie that I can't get to render html5 audio tags, or respect document.createElement('audio').canPlayType tests. Ridiculous.

I think IE worked this way only if there was no DOCTYPE. Or am I mistaking this with some other IE "bug"?

Although it's not guilty of this particular idiocy, IE does like to override MIME types by content- or extension-based guesses. So it would, sadly, not be that surprising.

<input type='file'> is unbelievable for its inability to be styled. IE is even more bizarre in that it displays the full path of the file chosen in a text field with a blinking cursor like you can type when active but ignores keyboard entry - except the backspace or delete keys that removes the file if there is one selected. IE11 changed file selection from double-click on mystery text field to single click on mystery text field. Browse always worked however.

For me, it works in Chrome but not IE.

I avoid IE too, but about 52% (and shrinking) visitors to sites I work with still do use IE so we still have to deal with it.

This is the first article I've read about this problem (thanks, HN.) Here's a quick summary of what I think I need to do about it: (corrections appreciated)

1) For any situations where you allow users to upload files which may be sent back to the browser as images, run some kind of check to ensure it's a valid image, e.g. ImageMagick "convert"

2) ensure you return content-type headers with the correct image type.


That's nice. The problem is that Internet Explorer doesn't conform to these standards. What do you do in this situation?

It's kind of ironic that this article praises IE, yet the article itself doesn't display properly in IE. The main article content is covered by the current projects. Works fine in Chrome though.

It was a bug because IE did not implement the spec. However, the spec was unintuitive and what IE did made more sense than the W3C box model.

Thanks for the info! It's helpful ... but looks like IE and Opera still don't respect this.

I did server side browser sniffing to give IE the version it understood (IIRC it couldn't handle well-formed XHTML served with the proper mime tag, not sure, it's been a while :D) while everything else got proper fully compliant XHTML. I'm pretty sure I used a code snippet from Anne van Kesteren who is also posting here ;)

Doesn't work in IE, last I checked.

This may come as a bit of a shock, but it doesn't seem to be working in IE.

OK, the spec is flawed. Other browser makers have solved that problem quite neatly by not implementing it.

It's also my opinion that while the implementation is strictly speaking correct, IE's default settings are too conservative and it is not at all an easy option for the user to change.


Ohhhh, so it's okay when webkit does it... just not IE.

It's not tested in IE, but we don't use any browserbspecific code (apart from chrome speech) so it might work just fine.

For server uploads, this would be pretty easy as a callback.


I didn't get any message like that in IE11 and Chrome.
next

Legal | privacy