tags:

views:

37

answers:

1

Hi

I am trying to unzip a .zip file by my code. I am using ZipArchive for that one. It is wokring fine but only problem is, when I add zip file which is zipped by "winzip version 9", it extracts empty folder.

Any Idea why it is happening ?

below is my code :

$zip = new ZipArchive();
$x = $zip->open($file_to_open);

if ($x === true) 
{

    $zip->extractTo($target . $unique_folder);
    $zip->close();

} else {

    die("There was a problem opening zip. Please try again!");

}

Please help. Thanks in advance.

A: 

I'm not sure about WinZip 9, but I know that WinZIP 10 supports new compression methods beyond the standard, age-old Deflate (eg. Bzip2, PPMd, etc.).

Last I checked, InfoZIP (the regular unzip command) doesn't support them while p7zip 7z x filename.zip does support at least some of them, so testing your archive with them is one way you could narrow down the problem.

ssokolow
Thanks for your input. I have fixed it using SSH "unzip" command.
aayushi
Don't forget to mark this as "Best Answer" once you decide no better ones are forthcoming. Most people don't bother to answer people who only have a 25% accept rate like yours.
ssokolow