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
For me, this mime type error showed only when testing Safari 4.05 per client requirements, and only in the console. Ultimately this was caused by Safari handling the javascript styling element.style.backgroundImage="url()";
ungracefully. Evidently, Safari was looking for that empty url, so per Strixy and stevecomrie, "none" is the better choice. This is essentially the same issue as noted above as near duplicate of Resource interpreted as other but transferred with MIME type text/javascript?, wherein a <script src="">
was the culprit.
My issue was with this line in the CSS
background-image: url('');
Which should have been:
background-image: none;
Please check extension of your image, whether the program used create the image labels its extension with capital letters or small letters, some servers read them different.
image is sent with wrong headers, add headers to image type via .htaccess
I checked out basically every similar question on StackOverflow trying to solve a similar issue.
After all the attempts at altering my htaccess file and inserting php head arguments, what fixed it for me was ...just changing the capitalization on the picture's name.
Ugh. (It was working fine in the same browser local-hosted, too... so of course I wouldn't think that was the issue initially.)
For magento2 Users
If you have modified this file app/etc/di.xml with following
<item name="view_preprocessed" xsi:type="object">Magento\Framework\App\View\Asset\MaterializationStrategy\Copy</item>
make sure the path string is Case Sensitive (CaseSensitive for non Windows OS)
If you are facing 404 errors after magento2 Install in Ubuntu.
Install and Enable rewrite module
a2enmod rewrite
Then Edit
/etc/apache2/sites-available/000-default.conf
Add following lines at the End
<Directory "/var/www/html">
AllowOverride All
</Directory>