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