【发布时间】:2013-02-11 19:02:12
【问题描述】:
我想生成由 Html 定义的多媒体文档(所谓的MIME)。
所以我可以在a single mhtml (MIME) file here(如:mime_example.doc)中打包相关文件(例如htm、图像...)。
但我只有php implementation here:A basic MIME 1.0 class helper
(在“基本的 MIME 1.0 类助手”部分)
还有the method to generatemhtml文件:
header('Content-Type: application/msword');
header('Content-disposition: filename=mydocument.doc')
$doc = New mime10class();
$doc->addFile('mydocument.htm','text/html; charset="utf-8"','Hello, world !');
$doc->addFile('subdir\anotherfile.htm','text/html; charset="utf-8"','Hi there.');
echo $doc->getFile();
但是如何使用 c++ 来实现呢?
(有用链接:MIME Encapsulation of Aggregate Documents, such as HTML (MHTML))
【问题讨论】:
-
您始终可以将格式正确的文本通过管道传输到字符串(流)中...
-
@aleguna:但我不想做铬。
-
@PlasmaHH,重点是实现编码。
-
@Rubby,你问如何在 C++ 中做到这一点,我给了你一个 C++ 实现的链接。您可以轻松地从 chomium/webkit 中提取生成 MHTML 的部分。问题解决了吗?