Forum


Replies: 6   Views: 3025
Set temp_path from code
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 jhanley  · 30-10-2019 - 23:48

Hello again,

I solved this issue and the solution turned out to be super easy. I simply prefixed the absolute server path to the filename parameter in createDocxAndDownload() and set the second parameter to true.

I actually disovered this solution while reading the documentation page for createDocx(), where the filename pararmeter description says, "The path to the resulting Word document."

https://www.phpdocx.com/api-documentation/layout-and-general/create-and-download-docx-with-PHP

However, the filename parameter description for createDocxAndDownload() says, "File name of the document to download."

https://www.phpdocx.com/api-documentation/layout-and-general/create-and-download-docx-with-PHP

This might be obvious to some, but I mistook this to mean the filename only and led me to believe the path is defined elsewhere (like in phpdocxconfig.ini).

I would suggest changing the filename description on the createDocxAndDownload documentation page.

In any event, thanks again for the support. I'm happy to put this issue to rest.