A call to createDocxAndDownload() with a filename that contains one or more directories will fail to download. I don't know if it's a bug or I'm using it incorrectly.
Generates the file in the correct path, but tries to download the file "file.docx" withouth the path, downloading a plain text file with the desired name (and extension) and a php error inside:
<p>Severity: Warning</p> <p>Message: filesize(): stat failed for file.docx</p> <p>Filename: Create/CreateDocx.inc</p> <p>Line Number: 3701</p>
Editing the file Classes/Phpdocx/Create/CreateDocx.inc, lines 3701 and 3702 solves my problem. From:
header('Content-Length: ' . filesize($fileNameDownload . '.' . $this->_extension)); readfile($fileNameDownload . '.' . $this->_extension);
header('Content-Length: ' . filesize($args)); readfile($args);
More changes should be required as this edit breaks calls to createDocxAndDownload without the filename parameter.