I try to unzip a files but i get the folowing warning.....
Warning: zip_open() Cannot open zip archive test1.zip in C:\Program Files\Apache Group\Apache2\h tdocs\rwinhttp\ extract.php on line 3
test1.zip is in the same folder with this script page.
i verified and the php_zip.dll and bz2.dll are actives in php.ini
This is the code
<?php
$zip = zip_open("test1 .zip");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
echo "Name: " . zip_entry_name( $zip_entry) . "\n";
echo "Actual Filesize: " . zip_entry_files ize($zip_entry) . "\n";
echo "Compressed Size: " . zip_entry_compr essedsize($zip_ entry) . "\n";
echo "Compressio n Method: " . zip_entry_compr essionmethod($z ip_entry) . "\n";
if (zip_entry_open ($zip, $zip_entry, "r")) {
echo "File Contents:\n";
$buf = zip_entry_read( $zip_entry, zip_entry_files ize($zip_entry) );
echo "$buf\n";
zip_entry_close ($zip_entry);
}
echo "\n";
}
zip_close($zip) ;
}
?>
Warning: zip_open() Cannot open zip archive test1.zip in C:\Program Files\Apache Group\Apache2\h tdocs\rwinhttp\ extract.php on line 3
test1.zip is in the same folder with this script page.
i verified and the php_zip.dll and bz2.dll are actives in php.ini
This is the code
<?php
$zip = zip_open("test1 .zip");
if ($zip) {
while ($zip_entry = zip_read($zip)) {
echo "Name: " . zip_entry_name( $zip_entry) . "\n";
echo "Actual Filesize: " . zip_entry_files ize($zip_entry) . "\n";
echo "Compressed Size: " . zip_entry_compr essedsize($zip_ entry) . "\n";
echo "Compressio n Method: " . zip_entry_compr essionmethod($z ip_entry) . "\n";
if (zip_entry_open ($zip, $zip_entry, "r")) {
echo "File Contents:\n";
$buf = zip_entry_read( $zip_entry, zip_entry_files ize($zip_entry) );
echo "$buf\n";
zip_entry_close ($zip_entry);
}
echo "\n";
}
zip_close($zip) ;
}
?>
Comment