Resource interpreted as image but transferred with MIME type text/html - Magento

前端 未结 15 2245
孤城傲影
孤城傲影 2020-12-05 06:48

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


        
相关标签:
15条回答
  • 2020-12-05 07:12

    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.

    0 讨论(0)
  • 2020-12-05 07:13

    My issue was with this line in the CSS

    background-image: url(''); 
    

    Which should have been:

    background-image: none;
    
    0 讨论(0)
  • 2020-12-05 07:15

    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.

    0 讨论(0)
  • 2020-12-05 07:15

    image is sent with wrong headers, add headers to image type via .htaccess

    0 讨论(0)
  • 2020-12-05 07:18

    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.)

    0 讨论(0)
  • 2020-12-05 07:19

    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>
    
    0 讨论(0)
提交回复
热议问题