Search code examples
cssimageinternet-explorernginxmime-types

Prevent IE aborts Images With The Wrong Mime-Type


I have a URL of an image

https://www.biossantibodies.com/image-raw/15986.jpg

If I copy that and paste it back on Chrome / Firefox / Safari

It will auto download and display, but IE doesn't do that.

This is what I see in IE:

enter image description here

Is it because of IE aborts Images With The Wrong Mime-Type ?


I've tried adjusting adding these 2 lines in my /etc/nginx/mime.types

image/jpeg                            jpeg;
image/jpg                             jpg;

How do I bypass that ?

Update

As suggested from @Manngo

I've tried

image/jpeg                            jpeg;
image/jpeg                            jpg;

and restart my NGINX Server

service nginx restart
nginx stop/waiting
nginx start/running, process 1755

Visit the URL (https://www.biossantibodies.com/image-raw/15986.jpg) in IE and still see the same result.

enter image description here


Solution

  • There is no image/jpg. Even with the .jpg extension, it should still be image/jpeg. Just change the second line as follows:

    image/jpeg  jpeg;
    image/jpeg  jpg;
    

    Basically, what you’re doing is matching file extensions to mime types. If you had an extension such as .junk, you could add that to the list too, if that’s your idea of having a good time:

    image/jpeg  junk;