【问题标题】:php com word.application outup to html file but unknow filephp com word.application 输出到 html 文件但未知文件
【发布时间】: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 而不是 SaveAsHTML 文件中的新文件,但它还不正确,任何人有任何想法,请建议我在 PHP 中进行操作

【问题讨论】:

    标签: php html com header-files


    【解决方案1】:

    我现在得到答案,我将这个答案发布给任何遇到像我这样的问题的人

    convert your file from .doc to .html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      • 1970-01-01
      • 2019-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多