[英]Is there a way to download pptx file with PHPPresentation?
I am using PHPPresentation for the first time and everything works fine, but I don't want to save file to some destination, I want to download that file through web browser.我第一次使用 PHPPresentation,一切正常,但我不想将文件保存到某个目的地,我想通过网络浏览器下载该文件。 How to do that?
怎么做?
Please help.请帮忙。
This is code to save file on some destination这是将文件保存在某个目的地的代码
$oWriterPPTX = IOFactory::createWriter($objPHPPresentation, 'PowerPoint2007');
$oWriterPPTX->save(__DIR__ . "/sample.pptx");
Try this code试试这个代码
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');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.