klu*_*msy 18 html converter mhtml
许多工具都有办法导出.MHT文件.我想要一种方法将该单个文件转换为文件集合,HTML文件,相关图像和CSS文件,然后我可以上传到webhost并供所有浏览器使用.有没有人知道任何工具或库或算法来做到这一点.
小智 12
那么,您可以在IE中打开.MHT文件并将其另存为网页.我用这个页面对它进行了测试,即使它在IE中看起来很奇怪(毕竟它是IE浏览器),它保存然后在Chrome中打开很好(因为它看起来应该如此).
除了该方法,查看文件本身,文本块按原样保存在文件中,所有其他内容保存在Base64中.每个内容项目前面都有:
[Boundary]
Content-Type: [Mime Type]
Content-Transfer-Encoding: [Encoding Type]
Content-Location: [Full path of content]
Run Code Online (Sandbox Code Playgroud)
其中[Mime类型],[编码类型]和[内容的完整路径]是可变的.[编码类型]似乎是base64或quoted-printable.[Boundary]在.MHT文件的开头定义,如下所示:
From: <Saved by WebKit>
Subject: converter - How can you programmatically (or with a tool) convert .MHT mhtml files to regular HTML and CSS files? - Stack Overflow
Date: Fri, 9 May 2013 13:53:36 -0400
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="----=_NextPart_000_0C08_58653ABB.B67612B7"
Run Code Online (Sandbox Code Playgroud)
使用它,您可以根据需要创建自己的文件解析器.