Have noticed that pasted svg’s in hype are being exported with an incorrect MIME type of XML Text Plain.
Came across this issue when I tried to upload a banner I made to my companies preview server and noticed the svg wasn’t loading up. Upon inspection of the console noticed it was incorrectly detecting the SVG by the wrong MIME type that was assigned when exported from Hype.
When you add a SVG file to the resource library, Tumult Hype won’t modify the file, so as long as it is valid SVG/XML, then it should work as expected.
(This is not a Hype issue, but an issue with whatever tool was used to produce the SVG file). A great tool for standardizing SVG output is SVGOMG: https://jakearchibald.github.io/svgomg/
Sorry I should have been more clear in my first post. This was literally just vector points pasted from Illustrator.
So copy pasted whatever was on Illustrator stage and then pasted into Hype. Shouldn’t Hype be doing something to edit the svg then to make it compliant?
Can you share your .svg file or better yet your .ai file? It may be the Illustrator is having issues with bitmaps or some other aspect of what you’re copying.
The quickest way to get a compliant SVG if your server is giving you issues would be to run your copied SVG directly into SVGOMG, which removes any unnecessary errata & minifies into this:
Changing the code of SVG content? I don't think we should be doing that. One thing that I think would be useful for us to do is to ensure that SVGs can be scaled more easily, which was discussed here. Updates to Illustrator and Sketch have resulted in better-performing SVGs so we may not need to take that road.
Regarding this post, the core of the issue is this:
The link you posted here, PastedVector.svg wrong MIME type is discussing how mime types are sent by the server when a file is served by apache down to a client.
This issue however is talking about a file that is uploaded to a server.
That server is then inspecting that file to get information like it’s mimetype.
Because this file does not include an XML declaration it does not identify it as and SVG.
As you stated the file passed W3C validation. But gives a waring.
That warning is fixable, and warns you of problems that can occur when files that are read from disk do not have an XML declaration. This is the problem we were facing.