|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39537 extractTo(dest,file) method doesn't work
Submitted: 2006-11-16 17:55 UTC Modified: 2006-11-19 03:24 UTC
From: hscheidegger at zumbach dot ch Assigned: pajoye (profile)
Status: Not a bug Package: Zip Related
PHP Version: 5.2.0 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
16 - 10 = ?
Subscribe to this entry?

 [2006-11-16 17:55 UTC] hscheidegger at zumbach dot ch
extractTo() method only works when extracting every file from the Zip archive.
Single and multiple file extraction does not work.

Win XP
Apache 2.2.3
PHP latest snap, ApacheModul

CLI doesn't work neither.

Regards, H-P Scheidegger


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-16 18:04 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

 [2006-11-16 18:23 UTC] hscheidegger at zumbach dot ch
use the script from the php documentation found here:

$zip = new ZipArchive;
$res = $zip->open('');
if ($res === TRUE) {
   $zip->extractTo('/my/destination/dir/', array('pear_item.gif', 'testfromfile.php'));
   echo 'ok';
} else {
   echo 'failed';
 [2006-11-16 18:33 UTC]
What is the actual result you get?
 [2006-11-16 21:27 UTC] hscheidegger at zumbach dot ch
When I do:
every file in the archive is extracted.

When I do:
$zip->extractTo('/my/destination/dir/', 'pear_item.gif');
no file is extracted and no error message appear.

When I do:
$zip->extractTo('/my/destination/dir/', array('pear_item.gif','testfromfile.php'));
no file is extracted and no error message appear.
 [2006-11-17 18:46 UTC]
I cannot reproduce it on windows and unix, using CLI, apache2 , IIS or CGI.

What's the status after the extractTo call? Can you paste it here? do a var_dump($zip); after having called it.

 [2006-11-18 11:33 UTC] hscheidegger at zumbach dot ch
I didn't know that the params of $zip->extractTo() are case sensitive, which is unusual for windows.
Nevertheless I have some cases, where the application hangs and I have to reboot the machine.
Give me some days to check this out.
 [2006-11-19 03:24 UTC]
Yes, it is case sensitive. It is in my todo to add a extended extract function. It will use the common flags (like ZIPARCHIVE::FL_NOCASE) or can based on special filters (like regexp or *.jpeg for example).

About your application hanging, it is a separate issue (if any), please open a new bug for it. I closed this one (bogus).
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 20:01:38 2019 UTC