Error uploading SVG file since early this week

Comments

7 comments

  • Avatar
    Michal Kuperman

    Hi Chee,

    There was a change in the limit of tags that can be included in an SVG file to protect against unsafe files. With that said, we have increased the limit, so you should be able to upload these files now.

    let us know how it goes,

     

    0
    Comment actions Permalink
  • Avatar
    Hisanobu Matsuhashi

    I can not upload also..

    About us, over 70KByte file size is avoided.

    0
    Comment actions Permalink
  • Avatar
    Jay Akhtar

    Hi Hisanobu,

    Thanks for reaching out.

    The default limit for uploading SVG/raw files is 10 MB for Free accounts. I was able to test upload an SVG file of 9.5 MB successfully to my Free account and getting a failed error message only when the file size exceeds the limit.

    To troubleshoot your case, I need additional account details such as the cloud name, actual SVG file, and the screenshots of the error message. Please open a support ticket by sending these details at support@cloudinary.com to continue this investigation.

    Best regards,
    Jay

    0
    Comment actions Permalink
  • Avatar
    Manuel Llorens

    Same problem here.

    No problem uploading SVG through the widget before this week, but I can not upload a 18 Kb SVG exported from GeoGebra. It upload OK using the web. I am using a Free account.

    The API writes in the console:

    Failed to load resource: the server responded with a status of 400 (Bad Request)

    And the widgets says:

    Raw file format svg not allowed
    0
    Comment actions Permalink
  • Avatar
    Stephen Doyle

    Hi Manuel,

    The error "Raw file format svg not allowed" means that both of the following conditions are true:

    1) Your upload API call, or the upload preset used by your upload, is specifying an 'allowed_formats' value, asking that all uploaded files are checked to see if they match the list of formats provided.

     2) The file you uploaded, when we opened it to validate it, was not detected as a valid SVG file, or SVG wasn't one of the allowed formats in your upload preset

    In can be confusing if the file is SVG, SVG is in the allowed list, and it's still rejected, but when you ask us to validate the format, we also open the file to detect and validate the format. For your example, it doesn't validate because the SVG is missing the first line with the XML information ( <?xml version="1.0" encoding="utf-8"?> ) so our format detection doesn't allow it.

    If you were able to upload this file using the Media Library but not via the Upload Widget on your own site, it may be because the Upload Widget is using a preset that includes allowed_formats but your account's default preset does not.

    If so, you can

    • Upload files which do have the <?xml> declaration on the first line
    • Remove the allowed_formats restriction from the upload preset used by the widget

    May I ask you to try those options and let me know if it works for you?
    Regards,
    Stephen

    0
    Comment actions Permalink
  • Avatar
    Appcues

    We're seeing the same issue that Manuel reported. We're using an upload policy with allowed_formats and need to keep the policy in place for security.

    I've validated that SVG files that have the XML declaration on line 1 upload with no issue but we are seeing many, if not most, of our users are attempting to upload SVGs that lack the XML declaration which results in a 400 response with the message

    Raw file format svg not allowed

    The first bullet in Stephen's response seems to indicate these files that do not have the XML declaration should be uploading however my experience does not match up with that. Is there any way to configure allowed_formats that will accept these SVG files that lack an XML declaration?

     

    0
    Comment actions Permalink
  • Avatar
    Michal Kuperman

    Hi Appcues,

    As Stephen mentioned both conditions are true when this error occurs: 1. `allowed_formats` included in your upload request  2. The SVG file is missing the first line with the XML information.

    Currently, if you include the `allowed_formats` in your request, the SVG file must have this XML information. With that said, we have an internal request to support these cases. Although I don't have an ETA at the moment we will update the thread with any new insights. 

    Thanks,

    Michal

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.