在Windows Azure网站中使用SVG

时间:2021-03-22 20:30:21

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.

有谁知道是否可以将SVG mime类型添加到Windows Azure网站?我尝试使用web.config文件,但这只会破坏我的网站。

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

这是当前预览的限制还是我遗漏了什么?

thanks for your help!

谢谢你的帮助!

1 个解决方案

#1


96  

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:

您可以在Windows Azure网站(在web.config级别上)执行的操作非常有限,但应该允许您在staticContent下添加mime类型:

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

#1


96  

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:

您可以在Windows Azure网站(在web.config级别上)执行的操作非常有限,但应该允许您在staticContent下添加mime类型:

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