Using SVGs via API turn into JSON Files

I’m having an issue / bug where every SVG I pass through to my CMS collections through the API results in a file.json → .json when I anticipate a file.svg → .svg

I’ve tried using all the solutions from this community forum, including SVGOMG tools (both UI and CLI) …and nothing will work. It seems that each time this topic is broached the thread is archived or isn’t answered fully.

Has anyone successfully resolved this issue before?

Previous community attempts from others (that weren’t answered) include:

.svg files converting to .json files

Webflow adding .JSON extension importing data

SVG import to CMS, broken?

As an example, I’m passing this value via API:

https://dl.airtable.com/.attachments/c1f972d8ad99d83a7031aeb6e6fa0d97/b16ce3b0/image.svg

It’s returning this:

icon: Object
fileId: “5ee96060145ecbd146965373”
url: “https://uploads-ssl.webflow.com/5d82419b585f0575118ed9ed/5ee96060145ecbd146965373_image.json
alt: null

If there’s a specific encoding Webflow expects I’m happy to conform, but the current outlook is bleak. There’s too many possible svg formats / xml variations to guess on my own.

FYI Julian_Wan

So I reported this to Webflow Customer Support on 2 July 2019. They said this:

Hello, Daniel!
Ben here with the Webflow Customer Support Team!
Thanks so much for reaching out about the issue you’re seeing with SVG images. This is definitely odd behavior.
I was able to reproduce this behavior on my end and I notified the team so they can take a closer look.
I can’t provide a timeline for when a fix will be available, but someone from the team will reach back out as soon as we know more.
Let me know if you have any other questions and I’ll be happy to assist you further!
All the best,
Ben

The last reply, after much nudging, was this on 19 August 2019:

Hello Daniel,
Thank you very much for your reply and follow-up on the issue of the SVG files converting to Json.
I can see that the issue is still open and has been reported to our team for change development, however I cannot give you an exact timeline for when the change will be pushed out.
Once there is more information and good news that a fix been pushed out, we will notify you immediately.
Let me know if you have any questions, I am here to help.
As a note, I can see that you have reached out about the invoices and I am taking a look at that and will reply on that ticket.
My best,
Dave

I haven’t heard from them about this since then.

I gave up and reverted to using pngs.

Thank you for adding your experience — it’s a little frustrating. I’ll keep trying various solutions.

I discovered that some SVGs will pass through properly, only if they include the following headers:

<?xml version="1.0" encoding="utf-8"?>

<!-- Generator: Adobe Illustrator 24.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->

However, not all are working. And using scripts from Illustrator hasn’t been successful yet.

I really wish Webflow Support followed up on all the original tickets…

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.