Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 49612
Status: rejected
Priority: 0/
Queue: CGI

People
Owner: MARKSTOS [...] cpan.org
Requestors: naiman [...] math.jct.ac.il
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: multipart POST form, with only one part
Date: Fri, 11 Sep 2009 02:56:38 +0200
To: bug-CGI.pm [...] rt.cpan.org
From: Aaron Naiman <naiman [...] math.jct.ac.il>
Dear Lincoln, et al., Hi. Okay, this took a very long time for me to find, a real hard one to crack. BTW, I am using FF 3.5.2 Windows XP (Opera was better i this regard, I think), and CGI 3.47. Say I have in foo.cgi: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv #!/usr/bin/perl -wT use strict; use warnings; print "Content-Type: text/html\n\n"; use CGI; print "Before new CGI object.\n"; my $query = CGI->new; print "After new CGI object.\n"; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ and in bar.html: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv <html><head></head><body> <form method="post" action="foo.cgi" enctype="multipart/form-data"> <input type="submit" value="Submit" /> </form> </body></html> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This croaks, with "Malformed multipart POST: data truncated" sent to the error log. The problem goes away without the enctype="multipart/form-data" , or, if I add any additional <input ...> field (even a hidden one) to the form. I do not understand why this should die is there is only one field. I also do not understand why this *all of a sudden* became an issue (4 hours ago, when I was supposed to go to bed! :-) ). This code gave me not problem until tonight, and I have not been able to ascertain something that I changed. Thanx for the thinx, Aaron -- Aaron ("Aharon") Naiman Jerusalem College of Technology--Machon Lev naiman@math.jct.ac.il http://math.jct.ac.il/~naiman
On Thu Sep 10 20:57:05 2009, naiman@math.jct.ac.il wrote: Show quoted text
> Dear Lincoln, et al., > > Hi. Okay, this took a very long time for me to find, a real hard one to > crack. BTW, I am using FF 3.5.2 Windows XP (Opera was better i this
regard, Show quoted text
> I think), and CGI 3.47. > > Say I have in foo.cgi: > > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv > #!/usr/bin/perl > -wT > > > use strict; > use warnings; > > print "Content-Type: text/html\n\n"; > > use CGI; > > print "Before new CGI object.\n"; > > my $query = CGI->new; > > print "After new CGI object.\n"; > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > and in bar.html: > > vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv > <html><head></head><body> > > <form method="post" action="foo.cgi" enctype="multipart/form-data"> > <input type="submit" value="Submit" /> > </form> > > </body></html> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > This croaks, with "Malformed multipart POST: data truncated" sent to the > error log. > > The problem goes away without the enctype="multipart/form-data" , or, if I > add any additional <input ...> field (even a hidden one) to the form. > > I do not understand why this should die is there is only one field. I
also Show quoted text
> do not understand why this *all of a sudden* became an issue (4 hours ago, > when I was supposed to go to bed! :-) ). This code gave me not problem > until tonight, and I have not been able to ascertain something that I > changed.
You can modify your script to see what the raw input is before CGI.pm processes it: ### print "Content-Type: text/html\n\n"; my @lines = <STDIN>; use Data::Dumper; warn Dumper ('my lines',\@lines); ### You will see that nothing is actually being submitted. This is explained here: http://dev.fyicenter.com/faq/xhtml/Values-Submitted-on-Submit-Button-Fields.html It says that when a submit button has no name, nothing is submitted for that button. The result is that you've posted absolutely nothing, so I think CGI.pm's response to that is reasonable. You could argue that CGI.pm should recognize that it's an empty but legitimate POST request, but I'm marking this bug as "rejected" for now. Mark
Subject: Re: [rt.cpan.org #49612] multipart POST form, with only one part
Date: Sun, 13 Sep 2009 22:03:43 +0200
To: bug-CGI.pm [...] rt.cpan.org
From: Aaron Naiman <naiman [...] math.jct.ac.il>
Dear Mark, Firstly, thank you very much for your time and your clearly explained response -- most appreciated! Thank you also for demonstrating the simple way of debugging this (I *should* have thought of that -- sorry). Great stuff at FYIcenter.com, so thanx for that link as well. :-) You could argue that CGI.pm should recognize that it's an empty but Show quoted text
> legitimate POST request, but I'm marking this bug as "rejected" for now. >
I *would* argue that -- but nonetheless accept your verdict. ;-) ATB, Aaron -- Aaron ("Aharon") Naiman Jerusalem College of Technology--Machon Lev naiman@math.jct.ac.il http://math.jct.ac.il/~naiman