Hi all,I'm trying to figure out how to handle file uploads from a user. I am using Mason with mod_perl2 under Apache 2.x, but I have a feeling this has nothing to do with Mason as I saw a similar question in December 2006 on this mailing list. Yet, there wasn't a relevant solution as the problem then seemed to have been with CGI.pm, but I'm not using it.
I enable apreq2 and then tried this:
my $contents = '';
my $req = Apache2::Request -> new ($r);
my $upload = $req->upload ('foo');
my $size = $upload -> slurp($contents);
with a form using the "post" method and an enctype of "multipart/form-data".
In my browser, I am getting a single message: "End of file found". That
is, the single line. Other print's that I had on the page for debugging
are not printed. There is nothing recorded in error.log and nothing in
the request in access.log indicates something is wrong.
The culprit is actually the third line because if I remove the fourth line, the problem remains. If I remove the third line, the page displays fine...
Any suggestions on what I am doing wrong or where I should look to figure out the problem? Thanks in advance!
Ray
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.