unable to open file with zip_open

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mihai123
    New Member
    • Mar 2007
    • 13

    unable to open file with zip_open

    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) ;

    }
    ?>
    Last edited by mihai123; Mar 22 '07, 10:18 AM. Reason: adding some info
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Please read the Posting Guidelines before you post in this forum!

    Especially the part about enclosing code within tags!!

    moderator

    Comment

    Working...