I'm very new to the zip functions in php and i'm trying to just read the files stored in a test zip i have.
this is what i'm getting:
php:
(this is plucked strait from php.net)
<?php
////////////////////////////////////
//* TESTING ZIP ARCHIVING IN PHP *//
////////////////////////////////////
$zip = zip_open("C:\Inetpub\wwwroot\ZipArchive\ziptest.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);
}
?>
results in:
Name: ziptest/ Actual Filesize: 0 Compressed Size: 0 Compression Method: stored File Contents: Name: ziptest/ag3ntavatar.png Actual Filesize: 7064 Compressed Size: 7064 Compression Method: stored File Contents: ‰PNG IHDR;AoœÜ_IDATh•{{Çy߯»gfgß{Oܸ8 ”D$dR¤^劥Ц) -Ê”¢*—+¥¤UY¥R¥lWTQ™b(Ñ”äT\Iô‡$K–d‰â+E‰_Ş$p8‡ÃápûšİyOwçÙž›İÛcè®ÚÛİÙ™îşú÷=~ß×}ÿ¼FSŸEêšès/ïÛMož?8ºcïž9İ4nr}÷ ™1+BÊR4 £( C‡s¾XzydttqË–-Kµ÷¼çÎ¨ÏØıÆì7¾šg×uÒó@ï{¯€½lèôÓŸü#:·s½~uytjûì'²…â‡ÛŽs“ëyîãhA@ ‰ˆG `šF 4ݰ°Æ[Êf³§·lûE>_ø'Ëj®lİ:)>ğõŽ¿Ù¼Òsê’ƒô<ĞOXô>„M|ü¯şRÛºcfjyyåóòÁ–íŒÖªU8Žƒ(Š’¥BPJ¡ë:! „€Òõù3¦!—˶·l{nË–Ñgfff^ĞucRV;xğ`{³Å~»ëämV¢·õ˜ŸùøÇµb1?vÓ-ş˜Ú}Õjí€eYšmÛÃRJ€”œs! ¥„®ë`ŒÆt]G©TB¹\F¹\F.—ƒaĞu=bŒ]‚ !²Yó/fg§_Ù³g~³¹ö»Ö#Üfh¦K Š{ß}¨²ïàşGsåò¿*ÕSµj žç%‚I)Á¥4ù.„€®ëÈårHËf³`Œ!xžÇq@-Š¢íœs0Æn*”Ëó…Bş}–û-~Ÿù `İfßñê¤;ùóÿø¥©á±-9¾÷GÕjÍ´¬V‚š”RMT¡ƒÎdQ,1::Š\.‡(ŠĞn·Ñjµ`YÚí6¢
- WAY MORE but you get the idea
I really need to get these functions under my belt.. I'll be using them in an application update environment where i'll need to zip up random files together.
thanks for your responses,
eff