Alternate way to upload the favicon.ico as facing the “we don't recognize or support this file extension type”

magento.stackexchange https://magento.stackexchange.com/questions/143357

  •  03-10-2020
  •  | 
  •  

Question

Even changing the /vendor/magento/module-catalog/view/adminhtml/web/catalog/base-image-uploader.js to acceptFileTypes: /(\.|\/)(gif|ico|jpe?g|png)$/i did not help with uploading .ico. Is there any other way?

Was it helpful?

Solution

The problem can be solved by changing line 70 in : module-theme/view/adminhtml/ui_component/design_config_form.xml

from

 item name="allowedExtensions" xsi:type="string">jpg jpeg gif png svg

to

 item name="allowedExtensions" xsi:type="string">ico jpg jpeg gif png svg 

please refer to this gihub issue #5478

NB: run php bin/magento cache:clean after edting the file, so the changes will take effect.

OTHER TIPS

First, don't touch magento core files.

I had the same problem.

For solve a problem you can Add custom favicons manually from your theme or can use my module with a bugfix.

https://packagist.org/packages/springimport/magento2-module-favicon-bugfix

First of all, you should not change files in the vendor directory, it's bad practice and a bad habit.

The best course of action would probably be to simply use a .png file. There really is no good reason to still use .ico files as you would really only need them for Internet Explorer 6 support - but considering that Magento 2 is not compatible with Internet Explorer 8 and below, you can safely use PNG files.

Alternatively, you can create the favicon.ico file in the custom directory of the Theme you use.

app/design/frontend/<YOUR_THEME_VENDOR>/<YOUR_THEME_NAME>/Magento_Theme/web/favicon.ico

You might need to restart your browser / clear the cache before the new favicon becomes visible as browsers tend to cache them rather "aggressively".

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top