note 105591 deleted from function.ziparchive-open by danbrown
| From: | danbrown@php.net | Date: | Tue, 30 Aug 2011 17:44:33 +0000 |
| Subject: | note 105591 deleted from function.ziparchive-open by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182836@lists.php.net to get a copy of this message | ||
Note Submitter: YiiWanAB at hotmail dot com
----
Most of the time people iterate over a directory with 'opendir' or 'readdir' to
add files to a zip. Like...
while ($file = readdir($dir)) { ... $zip->addFile($file) }
Note that $zip->addFile($file) will only work in the current directory if your at the root. You
will need to add the correct path to that $file string variable to have the full file name like ...
$zip->addFile($dir . DIRECTORY_SEPARATOR . $file); will work.
This may identify why you may get a read error when closing the file.
Enjoy.