MHT-File未在Internet Explorer中显示

时间:2012-07-10 12:35:31

标签: internet-explorer internet-explorer-9 base64 mhtml

我有一个mht-File,它不会在InternetExplorer 9中显示。我看过,text / html-part是用base64编码的:

Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: base64

这可能是因为IE9无法显示MHT文件吗?

2 个答案:

答案 0 :(得分:2)

Internet Explorer 9可以毫无问题地打开此类MHT文件。

以下是您可以测试的两个文件:

看看你是否可以打开这两个文件。

你也可以解码base64(例如,这里:http://www.opinionatedgeek.com/dotnet/tools/base64decode/)并查看它产生的HTML。如果base64编码的数据损坏,可能会产生浏览器无法显示的错误HTML。


更新:我查看了下面评论中链接的MHT文件。它不包含有效的HTML页面,因此无法在Internet Explorer中显示。

原始解码的HTML:

<P style="MARGIN: 0cm 0cm 0pt" class=yiv1976172747msonormal><FONT size=3>
<SPAN style="FONT-FAMILY: Arial; COLOR: black; mso-bidi-font-weight: bold">
My name is Walther </SPAN><SPAN style="COLOR: black"><?xml:namespace prefix = o
ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=yiv1976172747msonormal><FONT size=3><SPAN
style="FONT-FAMILY: Arial; COLOR: black; mso-bidi-font-weight: bold">I have some
money to invest in your country</SPAN><SPAN style="COLOR: black"><o:p></o:p>
</SPAN></FONT></P>
<P style="MARGIN: 0cm 0cm 0pt" class=MsoNormal><FONT size=3><SPAN
style="FONT-FAMILY: Arial; COLOR: black; mso-bidi-font-weight: bold">My email
</SPAN><B><SPAN style="FONT-FAMILY: Arial; COLOR: #ff6600">:</SPAN></B><FONT
face="Times New Roman"> </FONT></FONT><A href="mailto:dipl.george.walther@
hotmail.com"><SPAN style="TEXT-DECORATION: none; text-underline: none"><FONT
size=3 face="Times New Roman">dipl.george.walther@hotmail.com</FONT></SPAN>
</A><B><SPAN style="FONT-FAMILY: Arial; COLOR: #ff6600"><o:p></o:p></SPAN>
</B></P> 

当我删除Outlook添加的无效标记(<o:p>和类似标签)并在整个事物周围添加了<html>body标记时,MHT文件在Internet Explorer中正确打开。

简而言之,Outlook会生成错误的HTML,而Internet Explorer也不知道如何阅读它。

答案 1 :(得分:0)

如果从Web服务器下载mht文件,则CONTENT-DISPOSITION标头可能设置为Attachment,这将阻止在浏览器中查看IE9或更高版本。以下是解释: