Forum


Replies: 2   Views: 3822
Createdocxanddownload filename
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 pks  · 17-02-2012 - 00:00

If createDocxAndDownload parameter contains path, docx is correctly saved on disk, but the filename provided to the browser is bad, containing path too. So if you call createDocxAndDownload("./temp/test") the file test.docx is created in temp dir, but the open/save dialog in the browser comes with an ungly name like ._temp_test.docx

I think it would be nice to preserve the document name when outputting to browser, or at least let user control path in some other way.

My workaround was to put
(end(explode('/', $fileName)))
instead of
$fileName

in CreateDocx.inc line 2616