IIS 5 内容类型 - 错误

发布于 2024-10-09 09:36:47 字数 671 浏览 0 评论 0原文

IIS5、Windows 2000.ASP.Net 1.1 虚拟目录,NTFS,读取权限,web目录下有包含PPT和DOC文件的子目录。 asp.net 代码将这些 PPT 和 DOC 文件发送给用户(使用 IE6 和 8)。 (默认情况下,所有内容类型都在 IIS 中正确配置)在单独的计算机上还有另一个服务,基本上将这些 PPT 和 DOC 文件发布到同一目录,但使用 Windows 文件共享。很少有机会打开 PPT 文件并且发布服务正在发布完全相同的文件;但即使打开了,也只有IIS扔给客户端才能打开,所以发送给客户端的是只读版本。此外,对于所有来自 NTFS 权限和发布服务凭据的完全权限访问的已发布 PPT 和 DOC 文件,直接将其设置为只读。

一切通常都很好,直到发生未知的事情并且 IIS 5 为止,尽管它将 PPT 文件发送到客户端,但将内容类型发送为 text\xml,因此 IE6 和 Chrome 等浏览器无法呈现 PPT(二进制) )文件为 XML 并显示 XML 字符错误,而 IE 8 无论 Web 服务器作为内容类型发送什么,都会分析文件本身(以某种方式)并理解它是 PPT 文件而不是 XML,并通过安装的 MS PowerPoint 呈现它在计算机上(在 MS PowerPoint 窗口中,而不是 IE 窗口中 – ms office 2010)。

为什么 IIS 会有这样的行为?什么是(或可能是)根本原因?如何修复它?

IIS5, Windows 2000. ASP.Net 1.1
Virtual Directory, NTFS, Read Permissions, under the web-directory there is sub-directory that contains PPT and DOC files. The asp.net code sends these PPT and DOC files to User (with IE6 and 8). (All Content-Types are properly configured in IIS by default) There is another service on a separate machines, basically which publishes these PPT and DOC files to the same directory but using the Windows File Sharing. There is rare chance that the PPT file is opened and the publication service is publishing the very same; though even if it is opened, it will be opened only by IIS throwing it to client, so a read-only version has been sent to the client. Additionally the same directly with published PPT and DOC files is made as READONLY for all from NTFS permissions and Full Permission access for the Publication Service credentials.

All works usually well until something unknown happens and IIS 5, though it sends the PPT file to the client but sends the content-type as text\xml so browsers like IE6 and Chrome unable to render PPT (binary) file as XML and shows XML character error, while IE 8 irrespective of what web-server is sending as content-type analyses File by itself (somehow) and understands that it is a PPT file and not XML and renders it via MS PowerPoint installed on the machine (in the MS PowerPoint window not IE window – ms office 2010).

Why IIS is behaving like that? What is (or can be) root cause? How to fix it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文