Forum


Replies: 7   Views: 4428
Permission denied when trying to delete the last merged file
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 Many  · 21-09-2015 - 13:04

I had the same problem and fixed it by looking into the docx library. In phpdocx\classes\MultiMerge.inc there is an foreach loop for $documentArray as $key => $secondDocument. In this loop each file is opened, but never closed. So I added the following line "$this->_secondDocx->close();" at the end of the loop, and the last file in the array was deleted when using the unlink function.