【发布时间】:2015-01-15 03:55:40
【问题描述】:
这是我的代码:
$word = new COM("word.application");
$word->Visible = 1;
$word->Documents->Open('./../Team.docx');
$filename = tempnam(sys_get_temp_dir(), "");
$word->Documents[1]->SaveAs($filename);
$word->quit();
unset($word);
//header("Content-type: application/vnd.ms-word");
//header("Content-Disposition: attachment;Filename=test.doc");
header('Content-Encoding: UTF-8');
header('Content-type: text/html; charset= UTF-8');
header("Content-Disposition: attachment;Filename=Test.html");
// Send file to browser
readfile($filename);
unlink($filename);
我的想法是读取文件 Ms.Word 而不是 SaveAs 到 HTML 文件中的新文件,但它还不正确,任何人有任何想法,请建议我在 PHP 中进行操作
【问题讨论】:
标签: php html com header-files