0

Please help me.

Now i can't upload SVG image on Magento V-2.3.6. I tried with below code but still can't.

<type name="Magento\Cms\Model\Wysiwyg\Images\Storage">

<argument name="extensions" xsi:type="array">
<item name="allowed" xsi:type="array">
    <item name="jpg" xsi:type="string">image/jpg</item>
    <item name="jpeg" xsi:type="string">image/jpeg</item>
    <item name="png" xsi:type="string">image/png</item>
    <item name="gif" xsi:type="string">image/gif</item>
    <item name="svg" xsi:type="string">image/svg</item>
</item>
<item name="image_allowed" xsi:type="array">
    <item name="jpg" xsi:type="string">image/jpg</item>
    <item name="jpeg" xsi:type="string">image/jpeg</item>
    <item name="png" xsi:type="string">image/png</item>
    <item name="gif" xsi:type="string">image/gif</item>
    <item name="svg" xsi:type="string">image/svg</item>
</item>
<item name="media_allowed" xsi:type="array">
    <item name="flv" xsi:type="string">video/x-flv</item>
    <item name="swf" xsi:type="string">application/x-shockwave-flash</item>
    <item name="avi" xsi:type="string">video/x-msvideo</item>
    <item name="mov" xsi:type="string">video/x-sgi-movie</item>
    <item name="rm" xsi:type="string">application/vnd.rn-realmedia</item>
    <item name="wmv" xsi:type="string">video/x-ms-wmv</item>
</item>
0

Reference Link

Go To File: <your magento dir>/vendor/magento/module-cms/etc/di.xml

Add your extension you want to allow <item name="svg" xsi:type="number">1</item>

<argument name="extensions" xsi:type="array">
    <item name="allowed" xsi:type="array">
        <item name="jpg" xsi:type="number">1</item>
        <item name="jpeg" xsi:type="number">1</item>
        <item name="png" xsi:type="number">1</item>
        <item name="gif" xsi:type="number">1</item>
        <item name="svg" xsi:type="number">1</item>
    </item>
    <item name="image_allowed" xsi:type="array">
        <item name="jpg" xsi:type="number">1</item>
        <item name="jpeg" xsi:type="number">1</item>
        <item name="png" xsi:type="number">1</item>
        <item name="gif" xsi:type="number">1</item>
    </item>
    <item name="media_allowed" xsi:type="array">
        <item name="flv" xsi:type="number">1</item>
        <item name="swf" xsi:type="number">1</item>
        <item name="avi" xsi:type="number">1</item>
        <item name="mov" xsi:type="number">1</item>
        <item name="rm" xsi:type="number">1</item>
        <item name="wmv" xsi:type="number">1</item>
    </item>
</argument>
1
  • can't. show "File validation failed." – Nang Jan 28 at 11:48
0

Here is a free extension that does the trick: 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.