Reputation: 161
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.
Upvotes: 1
Views: 488
Reputation: 15345
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.
Upvotes: 1