Re: [PHP] zipped files

2005-10-27 Thread Clive

Hi,

I found that class but could not get it to work. Well it seem to work, 
as I could view the files information, but the extract() didn't do 
anything. I checked the writes for the directory the zip file was in and 
it did have wright rights. Maybe you can post a code snippet.


thanks

clive

James Lobley wrote:

This is the class I use:
http://www.phpconcept.net/pclzip/man/en/index.php


 On 10/26/05, Clive [EMAIL PROTECTED] wrote:


Hi

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.

clive

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







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



Re: [PHP] zipped files

2005-10-27 Thread Clive



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: $errorbr /\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



Re: [PHP] zipped files

2005-10-27 Thread James Lobley
These are the relevant sections from my code:

include(e:/bin/pclzip.php);
$provpath_dec = 'E:/Prov/Processed_Files/';
$provpath_unzip = 'E:/data/prov/';

$filename = '20051026202333.zip';

$archive = new PclZip($provpath_dec . $filename);
$archive-extract(PCLZIP_OPT_PATH, $provpath_unzip);

 As you'd probably guess from the paths shown, this is running on a windoze
box.
 James

 On 10/27/05, Clive [EMAIL PROTECTED] wrote:

 Hi,

 I found that class but could not get it to work. Well it seem to work,
 as I could view the files information, but the extract() didn't do
 anything. I checked the writes for the directory the zip file was in and
 it did have wright rights. Maybe you can post a code snippet.

 thanks

 clive

 James Lobley wrote:
  This is the class I use:
  http://www.phpconcept.net/pclzip/man/en/index.php
 
 
  On 10/26/05, Clive [EMAIL PROTECTED] wrote:
 
 Hi
 
 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.
 
 clive
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 

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




Re: [PHP] zipped files

2005-10-27 Thread Clive

Thanks

Im going to give it a try.

clive

James Lobley wrote:

These are the relevant sections from my code:

include(e:/bin/pclzip.php);
$provpath_dec = 'E:/Prov/Processed_Files/';
$provpath_unzip = 'E:/data/prov/';

$filename = '20051026202333.zip';

$archive = new PclZip($provpath_dec . $filename);
$archive-extract(PCLZIP_OPT_PATH, $provpath_unzip);

 As you'd probably guess from the paths shown, this is running on a windoze
box.
 James

 On 10/27/05, Clive [EMAIL PROTECTED] wrote:


Hi,

I found that class but could not get it to work. Well it seem to work,
as I could view the files information, but the extract() didn't do
anything. I checked the writes for the directory the zip file was in and
it did have wright rights. Maybe you can post a code snippet.

thanks

clive

James Lobley wrote:


This is the class I use:
http://www.phpconcept.net/pclzip/man/en/index.php


On 10/26/05, Clive [EMAIL PROTECTED] wrote:



Hi

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.

clive

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






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







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



Re: [PHP] zipped files

2005-10-27 Thread Clive

Thanks its working

clive

James Lobley wrote:

These are the relevant sections from my code:
 


include(e:/bin/pclzip.php);
$provpath_dec = 'E:/Prov/Processed_Files/';
$provpath_unzip = 'E:/data/prov/';

$filename = '20051026202333.zip';

$archive = new PclZip($provpath_dec . $filename);
$archive-extract(PCLZIP_OPT_PATH, $provpath_unzip);


 
As you'd probably guess from the paths shown, this is running on a 
windoze box.
 
James


 
On 10/27/05, *Clive* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
wrote:


Hi,

I found that class but could not get it to work. Well it seem to work,
as I could view the files information, but the extract() didn't do
anything. I checked the writes for the directory the zip file was in and
it did have wright rights. Maybe you can post a code snippet.

thanks

clive

James Lobley wrote:
  This is the class I use:
  http://www.phpconcept.net/pclzip/man/en/index.php
 
 
   On 10/26/05, Clive [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
 
 Hi
 
 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.
 
 clive
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 

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




--

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



Re: [PHP] zipped files

2005-10-26 Thread James Lobley
This is the class I use:
http://www.phpconcept.net/pclzip/man/en/index.php


 On 10/26/05, Clive [EMAIL PROTECTED] wrote:

 Hi

 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.

 clive

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




Re: [PHP] zipped files

2005-10-26 Thread Richard Lynch
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: $errorbr /\n . nl2br($output));
}
$unzipped = str_replace(.zip, '', $path);
$file = file_get_contents($unzipped);

-- 
Like Music?
http://l-i-e.com/artists.htm

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