romram
04-27-2004, 09:53 AM
I used the following code to unzip files using winzip command line, the command worked in the command window, but it didn't work in the code, it says that the file is unzipped but I can't see any thing...?
<?PHP
$root ='c:\\';
$unzipcmd = 'c:\>"c:\\program files\\winzip\\wzunzip" -d';
function unzip($source,$target) {
global $unzipcmd;
if (file_exists($source)) {
echo "unzipping $source to $target . . .<br>";
$cmd = $unzipcmd.' '.$source.' '.$target;
echo $cmd."<br>";
system($cmd,$return);
echo 'done. <BR>';
}
else return "File $source Not Found!<br>";
}
echo "<pre>".unzip($root."MyFile.zip","c:\\")."</pre>";
echo $root."<BR>";
?>
<?PHP
$root ='c:\\';
$unzipcmd = 'c:\>"c:\\program files\\winzip\\wzunzip" -d';
function unzip($source,$target) {
global $unzipcmd;
if (file_exists($source)) {
echo "unzipping $source to $target . . .<br>";
$cmd = $unzipcmd.' '.$source.' '.$target;
echo $cmd."<br>";
system($cmd,$return);
echo 'done. <BR>';
}
else return "File $source Not Found!<br>";
}
echo "<pre>".unzip($root."MyFile.zip","c:\\")."</pre>";
echo $root."<BR>";
?>