I'm using Apache to serve a webpage that contain some images. I have imags in both SVG and PNG format, and use content negotiation to serve the format that a client understands. As a result, the files that are referenced in the HTML do not have any extension (i.e. <img src="myimage"> instead of <img src="myimage.png">). This works fine in most browsers, but now I tested in IE8 and it does not display any of the images. It seems like IE is not able to determine the MIME type of the image, despite the server providing it in the HTTP response.

Is there any reasonable workaround for this problem? Is the same bug also present in newer versions of IE?

  • Shouldn't need to use a PNG fallback since you can render SVG on IE8 using SVGWeb > code.google.com/p/svgweb and many other solutions here > stackoverflow.com/questions/9353798/… Though no idea on the MIME, because I've used IE8 without extensions before without problem - can you add to your question the header response under IE8 please. – Simon Hayter Jul 10 '13 at 11:58
  • Aha, it seems like IE8 lies to the server that it supports SVG (Accept: */*) while it, in fact, does not. It then gets confused. Using svgweb is a possibility, but it does not seem very elegant or efficient. I'll probably just append ".png" to all image file names using JavaScript if IE8 is detected. – pafcu Jul 10 '13 at 12:06
  • That does sound like the best solution, be sure to come back and let us all know how to did the amend :P – Simon Hayter Jul 10 '13 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.