I'm having some issues, I'm using PCLZip to create an archive. I don't get any errors, the zip file is created, but when I go to view it, the archive is empty and on my windows machine I get an error "The Compressed (zipped) folder "local directory zip file") is invalid. I have the following code:
$dir = '../downloads/liability/';
$archive = new PclZip($dir.'archive.zip');
$v_list = $archive->create($dir);
if ($v_list == 0) {
die("Error : ".$archive->errorInfo(true));
}
My directory structure is:
-admin
--liabilityDev.php (where the above code resides)
--index.php
--commission.php
-downloads
--liability
---one.pdf
---two.pdf
The end result is that in the liability folder, there is a file called archive.zip which contains the 2 pdf's but I get the invalid error. If I don't have the directory variable, I archive index.php and commission.php and that works fine. It leads me to believe it may be a permission issue, but I'm running on fumes now. Please help!