Forum


Replies: 6   Views: 2884
Createdocx::$streammode creates a corrupt file
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  · 17-12-2017 - 08:55

Hello,

When you use the streamMode option (to avoid generating DOCX files in the fs) you need to use the createDocx method to generate the stream content. You can't use the createDocxAndDownload with the streamMode option, as the method uses PHP headers to download a DOCX file not a stream.

Please check the included samples in the package and the examples and information available on:

https://www.phpdocx.com/api-documentation/performance/zip-stream-docx-with-PHP

https://www.phpdocx.com/documentation/cookbook/improve-phpdocx-performance

Please enable the streamMode option and then use the createDocx method to generate the stream using PHP or Ajax.

Regards.