Hi Joe,
Joe Schaefer wrote:
running on a test machine (i.e., the web server isn't live on the
Internet) so perhaps I didn't set it up correctly?
I really don't know, it could be the parser is just misbehaving on your
particular html form. What you can do to further investigate is something like
this:
my $upload = eval { $req->upload("foo") };
if ($@) {
$upload = [EMAIL PROTECTED]>upload("foo"); # won't die this time
}
...
and try to see where the form data is getting lost.
For some reason, I am doubting my own HTML skills...or perhaps I've been
staring at this for so long, the screen is getting blurry :-) .
Anything here looks suspicious?
test1.html:
<form action="http://localhost/~user/test2.html" method="post"
enctype="multipart/form-data" name="mai nform">
<input type="file" name="filename" />
<input type="text" width="10" name="keyword" />
<button type="submit">Submit</button>
<button type="reset">Clear</button>
</form>
test2.html:
<%args>
$filename
$keyword
</%args>
<%perl>
print $filename, "<br />";
print $keyword, "<br />";
my $req = Apache2::Request -> new ($r);
my @params = $req -> param ();
print scalar (@params), "\n<br />\n";
</%perl>
<%
#my $upload = $req->upload ('filename');
%>
There's some Mason in there, but basically, both $filename and $keyword
print out ok (well, the filename), so it doesn't seem like any part of
the form is "lost". "scalar (@params)" is 0, though...which makes me
think I'm doing something wrong. Shouldn't it be 2? And of course, if
I move the commented line up, I get the "End of file found" error...
As much as I'd like to be like other newbies and blame either apreq2 or
the browser and say one of them is buggy :-) ...I'm more inclined to
believe that since other people use it, it must be something that I'm
doing wrong. If I remove the file input, and just leave the text box,
then I still get the error. So, it isn't because of the file
uploading... (I've changed the Subject to reflect this...)
Perhaps it's what I'm doing with Mason?
Ray
PS: I don't mean to put you on the spot, Joe, for replying to me
initially (which I am thankful for!). Of course, if anyone else can
give me their ideas, I'd appreciate it, too!