Re: zipped files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





Richard Lynch wrote:
On Wed, October 26, 2005 5:44 am, Clive wrote:

does any one have code/examples for unzipping a file thats been
uploaded
to a server. I would prefer a class rather than something that uses
zip.lib as it may not be configured on the server.


$path = "/full/path/to/uploaded/file.zip";
exec("/full/path/to/bin/unzip $path", $output, $error);
if ($error){
  die("OS Error: $error<br />\n" . nl2br($output));
}
$unzipped = str_replace(".zip", '', $path);
$file = file_get_contents($unzipped);


Is the unzip command standerd on linux systems?

What happens if the app is run on a windows machine. I Suppose I will have to include support for pkunzip or whatever its called nowadays.

clive

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux