【发布时间】:2020-03-01 18:28:10
【问题描述】:
我正在尝试在我的网页上获取 3d 模型,并发现这个非常不错的网站和教程,但是在我自己的网站中集成它会导致一些问题。
教程:https://doc.x3dom.org/tutorials/models/inline/index.html
起初将此示例代码复制到我自己的页面给了我一个 404.3,因为 IIS 不支持 .x3d 文件。
<x3d width='500px' height='400px'>
<scene>
<inline nameSpaceName="Deer" mapDEFToID="true" onclick='redNose();' url="Deer.x3d" > </inline>
</scene>
</x3d>
因为 .x3d 文件基本上是 XML。我将以下行添加到我的 web.config
<staticContent>
<remove fileExtension=".x3d" />
<mimeMap fileExtension=".x3d" mimeType="text/xml" />
</staticContent>
通过这些行查找文件不再给出 404,但是现在它给出了一个不被接受的通用 406.0。此外,根据 chrome 开发工具上的网络选项卡,它说类型是 xhr 而不是 xml。
【问题讨论】:
标签: asp.net web-config mime-types http-status-code-406