RE: Problems get DATA part from POST requests.

[prev] [thread] [next] [Date index for 2005/05/18]

From: Gerald Richter
Subject: RE: Problems get DATA part from POST requests.
Date: 04:31 on 18 May 2005
Hi,

Which version of Perl and CGI.pm you are using?

Gerald


-------------------------------------------------------------------------=
--
Gerald Richter            ecos electronic communication services gmbh
IT-Securityl=F6sungen * Webapplikationen mit =
Apache/Perl/mod_perl/Embperl

Post:       Tulpenstrasse 5          D-55276 Dienheim b. Mainz
E-Mail:     richter@xxxx.xx          Voice:   +49 6133 939-122
WWW:        http://www.ecos.de/      Fax:     +49 6133 939-333
-------------------------------------------------------------------------=
--
ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
-------------------------------------------------------------------------=
--

 =20

> -----Original Message-----
> From: Willem Jan Withagen [mailto:wjw@xxxxxxxx.xx]=20
> Sent: Friday, May 13, 2005 10:03 AM
> To: modperl@xxxx.xxxxxx.xxx
> Subject: Problems get DATA part from POST requests.
>=20
> Hi,
>=20
> I've inherited a large set of "old" mod_perl/Embperl websites=20
> from a crashed server.... Programming (mod_)perl is not yet=20
> my strongpoint at this moment, and the sites do not work when=20
> it needs to upload files. (It is a very old, selfmade CMS) I=20
> have do large experience in sysadmin and scripts in Perl4. :(
>=20
> It is running on FreeBSD 5.4, Apache/1.3.33 (Unix)=20
> Embperl/1.3.6 mod_perl/1.29
>=20
> And the snippet of code looks like this:
> 	# Get some fileproperties!
> 	$filename=3D$fdat{ImageName};
> 	$filename=3D~ m/.*\\(.*)/is;
> 	$shortname=3D$1;
> 	$contentinfo =3D$fdat{-ImageName} -> {'Content-Type'};
>=20
> 	$contentinfo =3D~ m/(.*?)\/(.*)/is;
> 	$contentsort=3D$1;
> 	$contenttype=3D$2;
>=20
> 	print LOG "[$$]ABCD: Opening $tmppath$tmpname.$$\n" ;
>      open FILE, "> $tmppath$tmpname.$$" ||
> 	print LOG "[$$]ABCD: Cannot open file=20
> $tmppath$tmpname.$$ for writing\n"; #store file in tmp dir.
> 	binmode FILE;
> 	$ok=3D1;
> 	$oversize=3D0;
>      while ($ok=3D=3D1)
> 		{
> 		$temp=3D0;
> 		$temp =3D read($fdat{ImageName}, $buffer, 16384);
> 		$size =3D $size + $temp;
> 		print FILE $buffer;
> 		print LOG "[$$]ABCD: Buffer: |$buffer|\n";
> 		if ($temp =3D=3D0) {$ok=3D0}   # exit, finished=20
> reading all data
> 		if ($size > $maxfilesize) {$oversized=3D1;$ok=3D0;}=20
> # toooo big	=09
> 		}
>      close FILE;
>   ---------------
>=20
> The print LOG are my doing....
> When this code gets executed it does open the file, filename=20
> and contentinfo are correctly extracted. Only the data in=20
> read is never there. The buffer is always empty. But I can=20
> not seem to graps why!?
>=20
> It could be configuration, although I'm led to believe that=20
> read-overloading is default present with mod_perl/Embperl. I=20
> did get Sessions to work with Apache::SessionX.
>=20
> I've also searched the archives but have only found some=20
> discussion from 2001 on this. And it either went away with=20
> upgrading mod_perl, or by completely overhauling the code.=20
> mod_perl is already very recent. And rewriting the code is=20
> something I try to prevent, since it'll might start to break=20
> even more.
>=20
> Does anybody have suggestions as to where to look??
> --WjW
>=20

Problems get DATA part from POST requests.
Willem Jan Withagen 08:02 on 13 May 2005

RE: Problems get DATA part from POST requests.
Gerald Richter 04:31 on 18 May 2005

Re: Problems get DATA part from POST requests.
Willem Jan Withagen 05:43 on 18 May 2005

RE: Problems get DATA part from POST requests.
Gerald Richter 07:58 on 18 May 2005

Re: Problems get DATA part from POST requests.
Willem Jan Withagen 12:03 on 18 May 2005

Generated at 15:53 on 25 May 2005 by mariachi v0.52