Reply to RE: [PHP] zipfile problems

Your name:

Reply:


Posted by George Pitcher on 04/07/05 15:10

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@gmail.com]
> Sent: 7 April 2005 1:04 pm
> To: George Pitcher; php-general@lists.php.net
> Subject: Re: [PHP] zipfile problems
>
>
> On Apr 7, 2005 1:54 PM, George Pitcher <george.pitcher@ingenta.com> 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@ingenta.com
> >
> > 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
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация