|
Posted by comp.lang.php on 09/30/05 17:56
Has anyone had any luck with file zipping utilities for PHP 4-5 and
Windows XP with Apache 2.0.53?
Following is my code snippet:
PHP Code:
if ($this->isSuccessful) { // RUN ZIP COMMAND BASED
UPON STRING
$zipName = ($album) ? "${section}s_$album" : "${section}s";
$zipName .= '.zip';
// NEW 4/1/2005 SEE NOTES IN classes.inc.php ON
getKommandOSArray() METHOD
list($zipKommand, $zipRedirect) =
@array_values($this->getKommandOSArray('zip-jF9'));
$msg = exec("$zipKommand $locationPath/$zipName " .
trim($imageList) . " $zipRedirect");
if (preg_match('/zip error:/i', $msg)) {
$this->isSuccessful = false;
$this->setErrorArray(array('action' => "Error attempting to
create zip file from album \"$album\": " . nl2br($msg)));
}
if ($this->isSuccessful && is_file("$locationPath/$zipName")
&& (int)@filesize("$locationPath/$zipName") >
(int)$maxDownloadableFileSize) {
$this->isSuccessful = false;
$this->setErrorArray(array('willDownloadDisk' => 'ZIP archive
file size is larger than maximum allowable downloadable file size of '
..
DownloadableComponentsView::displayReadableMaxDownloadableFileSize() .
', file
destroyed'
)
);
@unlink("$locationPath/$zipName");
}
}
}
Where "zip-jF9" in Windows comes out to be
Quote:
wzzip -u -en
I read online that WZZIP is a utility that will allow for using WinZip
in Windows within a command line prompt, which I would need to do in
order to use PHP's exec() command to do such.
Following are the steps I took:
1) Downloaded and installed WZZIP - making sure wzzip.exe and
wzunzip.exe exist in the same folder as winzip32.exe
2) Added "C:\Program Files\WinZip" to my PATH environmental variable
3) Rebooted
4) Restarted Apache
However, upon attempt to run the above PHP snippet, my Firefox and my
IE windows both locked up and Apache crashed!
I am thinking "WZZIP" is a big mistake, or, bad installation, or.. ??
Any thoughts or alternative ideas for file zipping in Windows using
PHP?
Thanx
Phil
Navigation:
[Reply to this message]
|