Friday, 15 July 2011

php - ZipArchive->deleteName not always working on Debian -


I have a ZIP archive with the file "file.txt" and a few others. I would like to remove this file and then remove it from the collection.

So I did this:

  chmod ($ file_path, 0777); If ($ zip-> open ($ file_path) === true) {if ($ zip-> extractTo ($ dir, array ('file.txt')) {$ zip- & gt; DeleteName ('file .text'); }}  

It works on my computer (Windows), but when I run it on my server (Debian), it is not for some collection (sometimes it Works, sometimes it does not happen). You know why ? Is it possible to do something like this?

  $ zip-> Delete name ('% file.txt%');  

Thanks for your help

related to this permission Chmod () may not work as expected, and when you create a collection by removing yourself and collecting it again, because it has already got the right permission

< P> The current user is the user under which PHP runs. This is probably not the only user that you use for common shell or FTP access. Mode can be changed only by the user who owns the file on most systems.

Then check that your user runs PHP is the owner of the folder.


No comments:

Post a Comment