SVG from Media Library downloading instead of displaying

Alonso Gonzalez asked on January 11, 2018 23:51

Hi there, Im trying to use a SVG file as an inline graphic like this :

But when I load the page instead of having the asset showing I'll get a save as window dialog to save the asset. Can you guys give a hand on how to avoid this?

Recent Answers


Trevor Fayas answered on January 12, 2018 00:30

This is actually going to be an issue with your IIS/web.config and not with Kentico.

You need to tell the site what a .svg file is for it's content type. Specifically, you need to set .svg to be the mime type/content type of image/svg+xml

In your Web.config, you'll need to find and add something like the below:

<configuration>
   <system.webServer>
      <staticContent>
         <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
      </staticContent>
   </system.webServer>
</configuration>
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.