简体   繁体   中英

ZipArchive in PHP does not unzip file

Here is the code I use

<?php
$zip = new ZipArchive;
     $res = $zip->open('file.zip');
     if ($res === TRUE) {
         $zip->extractTo('myextractdir/');
         $zip->close();
         echo 'Extracted';
     } else {
         echo 'failed';
     }
?>

It just outputs Extracted, but no files show up. The file is a zip file..

  1. Please check file permissions. Is the directory read-only?

If the directory is read-only, please set file permissions in either Windows or Linux.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM