-1

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. 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");

2 Answers2

0

PHPPresentation should work similiar to PHPExcel.

According to this question you can use:

$oWriterPPTX->save('php://output');
krylov123
  • 739
  • 8
  • 15
0

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');
Jinesh
  • 1,554
  • 10
  • 15