Support » Plugin: SVG Support » Cannot upload SVG files in WordPress 5.0.3

  • Resolved Cuong

    (@cuongtalentccc)


    When I upload the SVG file, the notification as below:
    “Sorry, this file type is not permitted for security reasons.”
    I’m in WordPress 5.0.3

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Benbodhi

    (@benbodhi)

    Hello,

    Please try again with the default twentyseventeen theme active to rule out any theme issues.

    Failing that, you may have to make sure your SVG has the correct header information before uploading.

    You can see our discussion about this already in here: https://wordpress.org/support/topic/sorry-this-file-type-is-not-permitted-for-security-reasons-16/

    Let me know how you go.

    Thread Starter Cuong

    (@cuongtalentccc)

    Hello Benbodhi,

    I tried to switch to the default theme Twenty Seventeen and the issue is still there.

    As you said, WordPress request <?xml version=”1.0″ encoding=”utf-8″?> for lastest WordPress Core and I think you are correct.

    I have no idea to change the correct header information of SVG. Can you tutorial by making a clip?

    Thanks!

    Plugin Author Benbodhi

    (@benbodhi)

    You just need to make sure you save it from illustrator (or your vector software), then open with a text editor like sublime text and you will see it. SVG files are actually just XML code 🙂

    Share your SVG with me and I can take a quick look and test it.

    • This reply was modified 3 years, 10 months ago by Benbodhi. Reason: Request file for testing

    Thank you Benbodhi, you reply helped me as well. SVG optimisation tools often remove the xml definition.

    Be careful to copy the right quotes:
    <?xml version="1.0" encoding="utf-8"?>

    Plugin Author Benbodhi

    (@benbodhi)

    @luke_antix My pleasure!

    That’s correct, I have found my go to optimisation techniques don’t work for now.

    I’ll hopefully find a way around this and will write it into my plugin.

    Thanks for your support.

    Thread Starter Cuong

    (@cuongtalentccc)

    @benbodhi I did it. Thanks so much.

    Hope you can fix it with the plugin for saving time.

    Plugin Author Benbodhi

    (@benbodhi)

    That’s great news @cuongtalentccc!
    Thanks for letting me know.

    Yes I hope to find a solution for this.

    I have the same issue. I downloaded Fontawesome and Icomoon SVG-Packages. Checked the code in sublime, seemed all good, but still not allowed to upload. Even after a few fixed I did.

    This is an example of one of the svg in the icomoon package:

    <?xml version="1.0" encoding="utf-8"?>
    <!-- Generated by IcoMoon.io -->
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
    <path fill="#000000" d="M16 9.226l-8-6.21-8 6.21v-2.532l8-6.21 8 6.21zM14 9v6h-4v-4h-4v4h-4v-6l6-4.5z"></path>
    </svg>
    
    Plugin Author Benbodhi

    (@benbodhi)

    Hi @scepticore,

    This thread is solved now, so please start your own thread if you’d like me to help you troubleshoot further.
    However, I have tested with your SVG code provided by saving it and uploading it exactly as you provided and it works fine. Here’s a screenshot of it in the media library: https://www.dropbox.com/s/6ykfxagppivs99k/Screenshot%202019-01-14%2021.15.43.png?dl=0

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Cannot upload SVG files in WordPress 5.0.3’ is closed to new replies.