有人知道如何将SVG文件类型添加到Windows Azure网站中吗?
我尝试使用web.config文件,但是这只会破坏我的网站。
这是当前预览版的限制还是我漏了什么?
谢谢你的帮助!
在Windows Azure网站(在web.config级别)中,您可以做的事情非常有限,但是您应该被允许在staticContent下添加mime类型:
<configuration>
<system.webServer>
<staticContent>
<remove fileExtension=".svg"/>
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
</staticContent>
</system.webServer>
</configuration>
像我这样的人可能会因为其他相关文件类型而没有解决同样的问题而到达这里,在我的情况下,我还需要.eot
和.woff
的mime映射。
<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>
<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>
<mimeType/>
之前添加一个<remove fileExtension=".svg"/>
。 - Bart Verkoeijen