note 57020 added to function.zip-open
| From: | robert at cotran dot ca | Date: | Wed, 21 Sep 2005 19:19:45 +0000 |
| Subject: | note 57020 added to function.zip-open | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-95557@lists.php.net to get a copy of this message | ||
The zip_entry_read above is wrong. Since the file was opened with popen, you have to read the file
in chunks, so zip_entry_read should read:
function zip_entry_read(&$res, $nbytes)
{
$contents = '';
while (!feof($res['fp'])) {
$contents .= fread($res['fp'], 8192);
}
return $contents;
}
Otherwise, it was a very useful library. Thanks!
----
Manual Page -- http://www.php.net/manual/en/function.zip-open.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+57020
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57020&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57020&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57020&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57020&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57020&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57020&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57020&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+57020&report=yes
Search -- http://master.php.net/manage/user-notes.php