note 47864 added to ref.zip
| From: | ren dot hong-lai at yellowsheepriver dot com | Date: | Fri, 03 Dec 2004 06:21:26 +0000 |
| Subject: | note 47864 added to ref.zip | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81307@lists.php.net to get a copy of this message | ||
hello,I'm a greener.
ON PHP WINDOWS SERVER:
1) Grab the php_zip.dll from the extensions dir in php-4.3.0pre2-Win32.zip
2) Add a line extension=php_zip.dll to your php.ini
3) Restart your web server
then,run test.php:
<?php
$zip = zip_open("test2.zip");
if ($zip)
{
while ($zip_entry = zip_read($zip))
{
echo "Name: " . zip_entry_name($zip_entry) . "\n";
echo "Actual Filesize: " . zip_entry_filesize($zip_entry) . "\n";
echo "Compressed Size: " . zip_entry_compressedsize($zip_entry) . "\n";
echo "Compression Method: " . zip_entry_compressionmethod($zip_entry) . "\n";
if (zip_entry_open($zip, $zip_entry, "r"))
{
echo "File Contents:\n";
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
echo "$buf\n";
zip_entry_close($zip_entry);
}
echo "\n";
}
zip_close($zip);
}
?>
but,display:
Warning: zip_open() Cannot open zip archive test2.zip in C:\Program files\Apache
Group\Apache2\htdocs\TEST.PHP on line 5.
please tell me,how to do? thank you!
----
Manual Page -- http://www.php.net/manual/en/ref.zip.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47864
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47864&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47864&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47864&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47864&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47864&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47864&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47864&report=yes
Search -- http://master.php.net/manage/user-notes.php