|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-10-18 12:28 UTC] jumpmanjay at juno dot com
Description: ------------ Zip enabled Extension Version $Id: php_zip.c,v 1.70 2006/08/14 15:54:34 pajoye Exp $ Zip version @PACKAGE_VERSION@ Libzip version 0.7.1 basically, we have a software provider that zips up logs automatically using Info-ZIP. the extensions used on php4 used to work with these logs, but it appears the new PECL ones dont. if i take the archive created, unzip it and re-zip it using either windoes compressed files, winzip, or winrar, the code below works as it should. re-zipping each file is not a real workaround... <a href="http://www.jasonyokoyama.com/misc/test.zip">here is a link to an example zip archive (ive even included the zip executable in the archive used to create this archive.</a> thanks! Reproduce code: --------------- $filename=$dir.$file.".zip"; $zip = new ZipArchive; $res = $zip->open(realpath($filename)); if ($res === TRUE) { echo 'ok'; $zip->extractTo('/www/ticketuploads/'.$username.'/'.$username); $zip->close(); } else { echo 'failed, code:' . $res; } Expected result: ---------------- expect to see zip contents in folder Actual result: -------------- it creates the folder, but with no contents PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 05:00:01 2025 UTC |
For the record, you can list the entries using this little snippet (you do not need absolute path anymore): $zip = new ZipArchive; $res = $zip->open("bug9082.zip"); for ($i=0; $i<$zip->numFiles;$i++) { echo "index: $i\n"; print_r($zip->statIndex($i)); }The problem is not ext/zip. Zip can read it smoothly. But mkdir does not work with paths like "./tmp/foo//bar/logs": mkdir("./tmp/foo//bar/logs",0777, true); Warning: mkdir(): No such file or directory in..cant just do mkdir(str_replace('//','/',$path),0777, true); ? :)