Is there any free SVG file extension that I can download and install(Magento2.4EE)? so I can upload SVG in CMS page.


Create one custom module and added this code into di.xml file of your module.

<type name="Magento\Cms\Model\Wysiwyg\Images\Storage">
        <argument name="extensions" xsi:type="array">
            <item name="allowed" xsi:type="array">
                <item name="svg" xsi:type="string">image/svg+xml</item>
            <item name="image_allowed" xsi:type="array">
                <item name="svg" xsi:type="string">image/svg+xml</item>
            <item name="media_allowed" xsi:type="array">
                <item name="svg" xsi:type="string">image/svg+xml</item>

The answer given by Dhiren Vasoya should be correct. Just be aware, that svg-files can be a security issue.

Where is the danger in SVG files?

The danger of an SVG file comes from the fact that it’s an XML that can have embedded CSS and JavaScript. The web browser will automatically run any JavaScript embedded in an SVG file. Therefore, if the script contains malicious code, it will place the user’s computer at risk.

Has there been any case of such attacks?

Yes. To date, there are over 8,000 recorded cases related to the security vulnerabilities of SVG files.

Source: https://blog.online-convert.com/svg-file-and-its-danger/


Yes, here is a free extension that allows uploading SVG and WebP images in Magento 2: https://github.com/MagestyApps/module-web-images

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.