RE: zipfile problems

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

 



Ken,

Thanks, but I did explain the problem. The zipfile contains only one of the
pdf files instead of the four that the script creates:

The actual script looks like this (just the zip bit):
==============================
$zipfile = new zipfile();
$zipfile -> add_dir("dir/");
$inputpath = "C:\\Program Files\\Apache
Group\\Apache2\\htdocs\\egretgui\\includes\\invoices\\";
$outputpath = "C:\\";
$outfile = $outputpath."inv_".date("Y_m").".zip";
if ($handle = opendir($inputpath)) {
	while (false !== ($file = readdir($handle))){
		$fn = explode(".",$file);
		if ($fn[1]=="pdf"){
			echo $inputpath.$file."<br>";
			$handle = fopen($inputpath.$file,"r");
			$filedata = fread($handle, filesize($inputpath.$file));
			$zipfile -> add_file($filedata, "dir/".$file);
		}
	}
}
$fd = fopen ($outfile, "wb");
$out = fwrite ($fd, $zipfile -> file());
fclose ($fd);
====================================================================

George


> -----Original Message-----
> From: Ken [mailto:kenkam@xxxxxxxxx]
> Sent: 7 April 2005 1:04 pm
> To: George Pitcher; php-general@xxxxxxxxxxxxx
> Subject: Re:  zipfile problems
>
>
> On Apr 7, 2005 1:54 PM, George Pitcher <george.pitcher@xxxxxxxxxxx> wrote:
> > Hi,
> >
> > My first posting for a long while.
> >
> > If anyone is using the 'class.zipfile.php' library, can they
> help me. I am
> > trying to create some PDFs, then zip and email them back to me.
> >
> > I get the zipfile but it only contains the first pdf file, even
> though 4 are
> > being created in my test site.
> >
> > I am getting the following errors on my page:
> > =============
> > Notice: Undefined variable: crc in C:\Program Files\Apache
> > Group\Apache2\htdocs\egretgui\includes\class.zipfile.php on line 62
> > Notice: Undefined variable: c_len in C:\Program Files\Apache
> > Group\Apache2\htdocs\egretgui\includes\class.zipfile.php on line 63
> > Notice: Undefined variable: unc_len in C:\Program Files\Apache
> > Group\Apache2\htdocs\egretgui\includes\class.zipfile.php on line 64
> > =============
> >
> > I've looked on the web and can't find any decent documentation for this
> > class.
> >
> > Can anyone help me get round this problem?
> >
> > For info, my server is NT4 and I'm using PHP 5.0.2.
> >
> > George
> >
> > ===
> >
> > George Pitcher
> > HERON Technical Manager
> > Ingenta plc
> > 23-38 Hythe Bridge Street, Oxford, OX1 2ET
> > T +44 (0)1865 799051 direct
> > T +44 (0)1865 799000 switchboard
> > F +44 (0)1865 799134
> > E george.pitcher@xxxxxxxxxxx
> >
> > www.ingenta.com
> >
> > Ingenta: Technology + Services for the Publishing and
> Information Industries
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> That's not really an error... that's just a notice... I think
> everything should be fine with the script.
>
> You might want to try turning off error_reporting in php.ini...
>
> Hope this helps...
>
> Ken
>

-- 
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