Forum


Replies: 2   Views: 4259
Docx not saved to file but displayed in cli
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 25-05-2018 - 06:27

Hello,

If you are using the stream mode and PHP CLI, then you need to redirect the stream to an output, otherwise the content is displayed.

If you set the stream mode as true and then you open the script using a web browser, the DOCX is generated and downloaded. If you use PHP CLI you can redirect it, for example to a file:

$ php stream_mode_script.php > output.docx

or any other output. This is the way how streams work.

Regards.