我第一次使用PHPPresentation,并且一切正常,但是我不想将文件保存到某个目标位置,我想通过Web浏览器下载该文件。该怎么做?
请帮助。
这是用于将文件保存到某个目标位置的代码
$oWriterPPTX = IOFactory::createWriter($objPHPPresentation, 'PowerPoint2007');
$oWriterPPTX->save(__DIR__ . "/sample.pptx");
答案 0 :(得分:0)
答案 1 :(得分:0)
尝试此代码
header("Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation");
header("Content-Disposition: attachment; filename=test.pptx");
$oWriterPPTX = IOFactory::createWriter($this->objPhpPresentation,'PowerPoint2007' );
$oWriterPPTX->save('php://output');