I'm getting below error when uploading a new product image for my Magento shop.
Resource interpreted as image but transferred with MIME type text/html
Is there a reason why this is happening?
This might well occur if your image path is set incorrectly. For example relative to current directory "images/myimage.gif" vs relative to web root "/images/myimage.gif".
The reference to "text/html" might suggest you have an error being returned by the server.
I noticed this problem appearing in my JavaScript Console log. It was a simple case of a CSS file looking for a background image that didn't exist and the server sending a 404 error message in its place.
One needs to serve the images with the proper MIME type -
Add this line into the .htaccess file (assuming it's apache2 httpd):
AddType image/gif .gif
hint: mod_rewrite might require an exclusion for images:
RewriteCond %{REQUEST_URI} !\.(png|gif|jpg)$
RewriteRule ...
... everything else might be 404 indeed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With