0
在阅读了关于如何使用php创建doc文件的几篇文章之后,我尝试了使用Open Office模板的OpenTBS方式,因为Fake HTTP Headers方式是不可能的样式。使用OpenTBS创建一个文档文件与PHP,如何下载?
我按照说明和脚本返回了我所需的输出,尽管它没有得到下载。我在error_log中没有错误,所以它一定是别的。任何一个已经使用它的人都可以帮忙?
<?php
include JPATH_BASE . DS . 'tbs_class.php';
include JPATH_BASE . DS . 'tbs_plugin_opentbs.php';
$TBS = new clsTinyButStrong;
$TBS->LoadTemplate('template.htm');
$method=$_GET['method'];
$id=$_GET['id'];
$teacher=$_GET['teacher'];
$html=DashHelper::getStudentFormForDL($method,$id,$teacher);//returns the html
$output_file_name = 'test.odt';
$message = $html;
$TBS->Show(OPENTBS_DOWNLOAD, $output_file_name);//this should dl the file
exit();
?>
此外,我用来创建文档文件的所有方法都来自过时的答案。有没有更简单的方法来实现这一点?