According to the documentation on the CreateDocx::createDocxAndDownload function, it is used to download the document as an output to the browser. It does this, however, I'm noticing that a duplication bug. I've attached my code below. As you can see, I'm providing the file a name of 'Policies-YYYY-MM-DD'. This name is outputted correctly and sent to the browser. However, it is also saved into the working directory where the script was executed from. I've only been able to replicate this with this name. If I change the date to be `date('Y-m-d_h:i:s')` it does not duplicate itself. I would not want to have to change the naming format of my document generation just because it causes duplication on the server. Any thoughts as to why this is happening?
require_once 'path_to_docx/classes/CreateDocx.inc';
$docx = new CreateDocxFromTemplate('filename.docx');
$docx->replaceVariableByText(array('YEAR' => date('Y')),array('target'=>'footer'));
$filename = 'Policies-'. date('Y-m-d');
$docx->createDocxAndDownload($filename);