Re: zipped files
| From: | Richard Lynch | Date: | Wed, 26 Oct 2005 17:05:27 +0000 |
| Subject: | Re: zipped files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-224685@lists.php.net to get a copy of this message | ||
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);
--
Like Music?
http://l-i-e.com/artists.htm