Thank you. We can now run ...\examples\Templates\processTemplate\sample_1.php using $streamMode without a corrupt file error.
But if we change sample_1 to use a simple form, we still get a corrupt file error when we open the download:
<?php
if ( isset( $_POST['tester'] ) ) {
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocxFromTemplate('../../files/TemplateVariables.docx');
$variables = $docx->getTemplateVariables();
$docx->processTemplate($variables);
CreateDocx::$streamMode = true;
$docx->createDocx('TEST');
}
?>
<br>-----TEST----<br><br>
<form action="" method="post">
<input type="hidden" name="tester" value="1" >
<input type="submit" value="Submit">
</form>
If we use the same form but remove $streamMode and use $docx->createDocxAndDownload instead, the download is not corrupted, but we have a copy in our fs.