cmplieger
cmplieger

Reputation: 7351

Use SVG in Windows Azure Websites

Does anyone know if it is possible to add the SVG mime type to a Windows Azure Website? I tried with a web.config file but that only broke my website.

Is this a limitation of the current preview or am I missing something?

thanks for your help!

Upvotes: 54

Views: 16875

Answers (3)

Isham Sally
Isham Sally

Reputation: 189

This is what I did following the new icon standards that you need these days from using https://www.iana.org/assignments/media-types/media-types.xhtml#font

<staticContent>
    <remove fileExtension=".svg" />
    <remove fileExtension=".eot" />
    <remove fileExtension=".woff" />
    <remove fileExtension=".woff2" />
    <mimeMap fileExtension=".svg" mimeType="image/svg+xml"  />
    <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
    <mimeMap fileExtension=".woff" mimeType="font/woff" />
    <mimeMap fileExtension=".woff2" mimeType="font/woff2" />
</staticContent>

Upvotes: 1

Ahmad
Ahmad

Reputation: 51

Others like me may have reached here having the same problem not resolved because of other related file types, in my case I also needed .eot and .woff mime mappings.

<system.webServer>
    <staticContent>
        <remove fileExtension=".svg" />
        <remove fileExtension=".eot" />
        <remove fileExtension=".woff" />
        <mimeMap fileExtension=".svg" mimeType="image/svg+xml"  />
        <mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
        <mimeMap fileExtension=".woff" mimeType="application/x-woff" />
    </staticContent>
</system.webServer>

Upvotes: 2

Sandrino Di Mattia
Sandrino Di Mattia

Reputation: 24895

What you can do in Windows Azure Websites (on web.config level) is pretty limited, but you should be allowed to add the mime type under staticContent:

<configuration>
   <system.webServer>
      <staticContent>
         <remove fileExtension=".svg"/>
         <mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
      </staticContent>
   </system.webServer>
</configuration>

Upvotes: 105

Related Questions