• Resolved garaldo22

    (@garaldo22)


    Hi. Since the last update I can’t upload any SVGs. Just get “Error While Uploading File xxx.svg to the Media Library

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

    (@benbodhi)

    Hi there. Sorry to hear.

    Might seem silly but can you please confirm you have the right SVG Support settings for allowing SVG uploads for your role?

    If you do, please share what role your account has and what settings you’re using.

    There was an update to the way rest api uploads are handled which shouldn’t affect regular media library uploads in admin.

    • This reply was modified 4 weeks, 1 day ago by Benbodhi. Reason: fixed autocorrect to say shouldn’t instead of should
    Thread Starter garaldo22

    (@garaldo22)

    I’m using:
    Restrict SVG Uploads to? Administrator
    Do not sanitize for these roles Administrator Editor

    Plugin Author Benbodhi

    (@benbodhi)

    I’m not seeing any issues uploading to the media library with the same settings. (Note that the sanitization bypass for editor role won’t work since editors can’t upload unless selected in the allowed roles field above).

    If you’re logged in as admin, and have admin selected in allowed roles, you should be fine to upload SVG files regardless of the sanitization bypass for admin option.

    I’ve just tested and can’t reproduce your issue. If you could please share as much info as possible, like server setup, php version, and the SVG file itself, I’ll be happy to keep trying to reproduce the issue.

    Also might be worth testing with all other plugins deactivated in case it’s a plugin conflict somewhere.

    Thread Starter garaldo22

    (@garaldo22)

    I’ve tried with different svg files. On upload the image briefly appears but greyed out, then the block reverts to the upload image block and I get the error msg. Here’s server setup:

    Server architectureLinux 4.18.0-513.24.1.lve.el8.x86_64 x86_64
    Web serverLiteSpeed
    PHP version7.4.33 (Supports 64bit values)
    PHP SAPIlitespeedPHP max input variables8000
    PHP time limit360P
    HP memory limit512M
    Max input time240
    Upload max filesize256M
    PHP post max size256
    McURL version8.11.0 OpenSSL/1.1.1w
    Is SUHOSIN installed?No
    Is the Imagick library available?Yes
    Are pretty permalinks supported?Yes.
    htaccess rulesCustom rules have been added to your .htaccess file.

    Plugin Author Benbodhi

    (@benbodhi)

    ok I found the issue. apparently when an SVG file doesn’t have an XML tag at the start, php 8 will return mime type with svg+xml still so it works fine, but php 7.4 returns only svg which my filtering was not checking for.
    I’ve adjusted the check to support svg+xml as well as svg on its own in v 2.5.12 which you can update to now and check for yourself to be sure.
    Let me know if you still see issues.
    It’s probably worth updating to php 8+ these days, but this was a good catch to make sure it works in older versions.

    Thread Starter garaldo22

    (@garaldo22)

    Thanks, all works good now!

    Plugin Author Benbodhi

    (@benbodhi)

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

    Would be awesome if you could take a minute to leave a review of the plugin ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.