Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 81295 invoked from network); 7 Dec 2006 09:30:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2006 09:30:45 -0000 Received: (qmail 58892 invoked by uid 500); 7 Dec 2006 09:30:47 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 58875 invoked by uid 500); 7 Dec 2006 09:30:46 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 58864 invoked by uid 99); 7 Dec 2006 09:30:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 01:30:46 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [208.3.90.32] (HELO exchfront1.pub.prevare.com) (208.3.90.32) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Dec 2006 01:30:34 -0800 Received: from exchback1.pub.prevare.com ([208.3.90.34]) by exchfront1.pub.prevare.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 7 Dec 2006 04:30:12 -0500 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C719E2.49CD4F66" Subject: RE: Apache2::Upload and End of file found error Part 2 Date: Thu, 7 Dec 2006 04:30:09 -0500 Message-ID: <337EB977ED442643A70817574C83BA770FF279@exchback1.pub.prevare.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Apache2::Upload and End of file found error Part 2 thread-index: AccZ0fVK9bHy7nH0SRq9tnCBKnVX1wAD36UV References: <337EB977ED442643A70817574C83BA770FF276@exchback1.pub.prevare.com> <337EB977ED442643A70817574C83BA770FF278@exchback1.pub.prevare.com> <4577C3B4.7090903@redhotpenguin.com> From: "cfaust-dougot" To: "Fred Moyer" Cc: X-OriginalArrivalTime: 07 Dec 2006 09:30:12.0910 (UTC) FILETIME=[4BD804E0:01C719E2] X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------_=_NextPart_001_01C719E2.49CD4F66 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thanks for the tips Fred, but I don't understand what you mean about the = CGI object being shared between requests - that CGI object wasn't global = or anything, its created and used within that sub and that's it?? =20 I don't know if I can remove the use of CGI.pm completely, is there no = way to get them to work together?? =20 Thanks -Chris ________________________________ From: Fred Moyer [mailto:fred@redhotpenguin.com] Sent: Thu 12/7/2006 2:33 AM To: cfaust-dougot Cc: modperl@perl.apache.org Subject: Re: Apache2::Upload and End of file found error Part 2 cfaust-dougot wrote: > Folks, >=20 > I'm still trying to figure out what to do about this upload problem.. = I've figured out that somehow creating a new CGI object is causing the = problem but I have no idea how or what to do. >=20 > Below is a bare bone test upload script, if you comment out the "my = $CGI =3D new CGI();" in the sub "init_global_vals" then the update works = fine, if its uncommented then the server error of "End of file found" = happens. >=20 > http://208.3.90.212/test.pm.txt >=20 > I have no idea how one relates to the other, any ideas? I'm not sure why you would want a CGI object shared between requests but my guess is that it's doing something strange as a result and I can't see any advantage to that approach. If you don't have that $CGI object around and it works fine that might be telling you that it's causing trouble and not helping. A few other comments that might keep you from running into other = problems: 1) 'perldoc vars' - use 'our' in favor of 'use vars' 2) don't use global variables unless you really need them and they serve a useful purpose ($template_header and $template_footer globals are ok since they are stateless, $CGI objects are not) 3) try the latest version of libapreq, 2.08. I don't think it will fix your existing problem (which the $CGI seems to be the root of), but there have been a number of bug fixes since the release you're using. 4) Take a look at Apache::DBI instead of keeping $db in a global - $db =3D ISMH::ConnectDBUser->connect_to_db(); HTH - I think the simple issue to fix your problem is don't use a global $CGI object FWIW >=20 > Thanks > -Chris > > ________________________________ > > From: cfaust-dougot [mailto:cfaust@doyougot.com] > Sent: Tue 12/5/2006 1:28 PM > To: modperl@perl.apache.org > Subject: Apache2::Upload and End of file found error > > > Hi, >=20 > I'm trying to use Apache2::Upload as shown in the examples and the = only thing I get is "End of file found" in the error log. >=20 > I've found quite a few messages on the subject, but I'm not using = Mason and I'm using libapreq2.0.7.1. >=20 > I've tried the fh and slurp methods and both are the same. >=20 > Code I've been playing with >=20 > my $req =3D Apache2::Request->new($r); > my $upload =3D $req->upload('new_image'); > my $size =3D $upload->size; > my $uploaded_file =3D $upload->fh; > #$upload->slurp($uploaded_file); > #$upload->link($uploaded_photo_name) or > # die sprintf "link from '%s' failed: $!", $upload->tempname; >=20 > Server Info > Apache/2.0.55 (Ubuntu) PHP/5.1.6 mod_apreq2-20051231/2.5.7 = mod_perl/2.0.2 Perl/v5.8.8 configured >=20 > TIA > ------_=_NextPart_001_01C719E2.49CD4F66 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: Apache2::Upload and End of file found = error Part 2=0A= =0A= =0A= =0A=
=0A=
Thanks for = the tips Fred, but I don't understand what you mean about the CGI object = being shared between requests - that CGI object wasn't global or = anything, its created and used within that sub and that's = it??
=0A=
 
=0A=
I don't know if I can remove = the use of CGI.pm completely, is there no way to get them to work = together??
=0A=
 
=0A=
Thanks
=0A=
-Chris
=0A=

=0A=
=0A= From: Fred Moyer = [mailto:fred@redhotpenguin.com]
Sent: Thu 12/7/2006 2:33 = AM
To: cfaust-dougot
Cc: = modperl@perl.apache.org
Subject: Re: Apache2::Upload and End = of file found error Part 2

=0A=
=0A=

cfaust-dougot wrote:
> = Folks,

> I'm still trying to figure out what to do = about this upload problem.. I've figured out that somehow creating a new = CGI object is causing the problem but I have no idea how or what to = do.

> Below is a bare bone test upload script, if = you comment out the "my $CGI =3D new CGI();" in the sub = "init_global_vals" then the update works fine, if its uncommented then = the server error of "End of file found" happens.

> = http://208.3.90.212/test.pm.txt<= /A>

> I have no idea how one relates to the other, = any ideas?

I'm not sure why you would want a CGI object shared = between requests but
my guess is that it's doing something strange as = a result and I can't
see any advantage to that approach.  If you = don't have that $CGI object
around and it works fine that might be = telling you that it's causing
trouble and not helping.

A few = other comments that might keep you from running into other = problems:

1) 'perldoc vars' - use 'our' in favor of 'use = vars'

2) don't use global variables unless you really need them = and they serve
a useful purpose ($template_header and = $template_footer globals are ok
since they are stateless, $CGI = objects are not)

3) try the latest version of libapreq, = 2.08.  I don't think it will fix
your existing problem (which = the $CGI seems to be the root of), but
there have been a number of = bug fixes since the release you're using.

4) Take a look at = Apache::DBI instead of keeping $db in a global -
$db =3D = ISMH::ConnectDBUser->connect_to_db();

HTH  - I think the = simple issue to fix your problem is don't use a
global $CGI object = FWIW


> Thanks
> -Chris
>
> = ________________________________
>
> From: cfaust-dougot [
mailto:cfaust@doyougot.com]
&g= t; Sent: Tue 12/5/2006 1:28 PM
> To: = modperl@perl.apache.org
> Subject: Apache2::Upload and End of file = found error
>
>
> Hi,

> I'm trying = to use Apache2::Upload as shown in the examples and the only thing I get = is "End of file found" in the error log.

> I've = found quite a few messages on the subject, but I'm not using Mason and = I'm using libapreq2.0.7.1.

> I've tried the fh and = slurp methods and both are the same.

> Code I've = been playing with

>  my $req =3D = Apache2::Request->new($r);
>  my $upload =3D = $req->upload('new_image');
>  my $size =3D = $upload->size;
>  my $uploaded_file =3D = $upload->fh;
>  = #$upload->slurp($uploaded_file);
>  = #$upload->link($uploaded_photo_name) = or
>     #  die sprintf "link from '%s' = failed: $!", $upload->tempname;

> Server = Info
> Apache/2.0.55 (Ubuntu) PHP/5.1.6 mod_apreq2-20051231/2.5.7 = mod_perl/2.0.2 Perl/v5.8.8 configured

> = TIA
>

------_=_NextPart_001_01C719E2.49CD4F66--