Forum


Replies: 1   Views: 2708
Createdocxanddownload errors
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 sam3d  · 16-12-2017 - 21:46

Using the latest Premium version - 

Using a simple form with method post. 

CreateDocx::$streamMode = true;
$docx->createDocxAndDownload('test');

The document is created and downloaded. 

But our log shows these entries: 

[16-Dec-2017 21:30:41 UTC] PHP Warning: Â Cannot modify header information - headers already sent by (output started at .../classes/ZipStream.inc:80) in .../classes/CreateDocx.inc on line 4033
[16-Dec-2017 21:30:41 UTC] PHP Warning: Â Cannot modify header information - headers already sent by (output started at .../classes/ZipStream.inc:80) in .../classes/CreateDocx.inc on line 4037
[16-Dec-2017 21:30:41 UTC] PHP Warning: Â Cannot modify header information - headers already sent by (output started at .../classes/ZipStream.inc:80) in .../classes/CreateDocx.inc on line 4039
[16-Dec-2017 21:30:41 UTC] PHP Warning: Â filesize(): stat failed for ./test.docx in .../classes/CreateDocx.inc on line 4040
[16-Dec-2017 21:30:41 UTC] PHP Warning: Â Cannot modify header information - headers already sent by (output started at .../classes/ZipStream.inc:80) in .../classes/CreateDocx.inc on line 4040
[16-Dec-2017 21:30:41 UTC] PHP Warning: Â readfile(./test.docx): failed to open stream: No such file or directory in .../classes/CreateDocx.inc on line 4041

 

If we use ajax to handle the form submission, it does not work, no docx is downloaded and the error log shows  just this: 

[16-Dec-2017 21:04:13 UTC] PHP Warning:  filesize(): stat failed for ./test.docx in .../classes/CreateDocx.inc on line 4040
[16-Dec-2017 21:04:13 UTC] PHP Warning:  readfile(./test-room-block.docx): failed to open stream: No such file or directory in .../classes/CreateDocx.inc on line 4041

 

We have tried your alternative method  and get the same error messages. 

We would like to get a  stream download working with ajax.  

[ just fyi - Using our own code, we are able to generate and force download for excel files via ajax without any issues. ]