1

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.

4

1 回答 1

1

我不确定 WinZip 9,但我知道 WinZIP 10 支持超越标准、古老的 Deflate 的新压缩方法(例如 Bzip2、PPMd 等)。

最后我检查了一下,InfoZIP(常规unzip命令)不支持它们,而 p7zip7z x filename.zip至少支持其中一些,所以用它们测试你的存档是缩小问题范围的一种方法。

于 2010-09-14T02:55:58.830 回答