Question

I have a mht-File which will not be shown in InternetExplorer 9. I have seen, that the text/html-part is encoded in base64:

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

Could this be the reason, that IE9 will not be able to show the MHT-File?

Was it helpful?

Solution

Internet explorer 9 can open such MHT files with no problem.

Here are two files you can test with:

See if you can open both of those files.

You can also decode the base64 (for example, here: http://www.opinionatedgeek.com/dotnet/tools/base64decode/) and see what HTML it produces. If the base64-encoded data is corrupt, it may produce bad HTML that the browser cannot display.


UPDATE: I looked at the MHT file linked in the comment below. It does not contain a valid HTML page in it and therefore it cannot be displayed in Internet Explorer.

The original decoded 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> 

When I removed the invalid tags added by Outlook (the <o:p> and similar) and added <html> and body tags around the whole thing, the MHT file opened correctly in Internet Explorer.

In short, Outlook produces bad HTML and Internet Explorer doesn't know how to read it.

OTHER TIPS

If the mht file is downloaded from a web server, the CONTENT-DISPOSITION header may be set to Attachment, which would prevent it from being viewed in the browser for IE9 or greater. Here is the explanation:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top