Hi,
I'm trying to allow files to be uploaded through Mason. My setup is as
follows:
Apache 2.2.3
Mason 1.3.4
mod_apreq2 20051231/2.6.0
mod_perl 2.0.2
The following is my code:
<form METHOD="POST" ENCTYPE="multipart/form-data">
<input type="file" name="file">
<input type="submit">
</form>
Mason Version: <% $HTML::Mason::VERSION %><br>
<%perl>
use Apache2::Upload;
my $content = '';
my $req = Apache2::Request-> new($r);
my $upload = $req-> upload("file");
my $size = $upload-> size;
$upload-> slurp($content);
</%perl>
<form METHOD="POST" ENCTYPE="multipart/form-data">
<input type="file" name="file">
<input type="submit" name="action" value="Upload" />
</form>
Mason Version: <% $HTML::Mason::VERSION %><br>
<%perl>
if ( $action eq 'Upload' ) {
use Apache2::Upload;
my $content = '';
my $req = Apache2::Request-> new($r);
my $upload = $req-> upload("file");
my $size = $upload-> size;
$upload-> slurp($content);
}
</%perl>
After reading online, it seems I have to add this to my httpd.conf:
PerlSetVar MasonArgsMethod mod_perl
Which I did. The file upload process still quits with a "End of file
found" error.
How can I confirm that mod_perl is actually being set to MasonArgsMethod?
Do I put anything special into handler.pl, which is:
my $ah = new HTML::Mason::ApacheHandler( comp_root =>
'/opt/local/apache2/htdocs/',
data_dir => '/opt/local/mason-data',
allow_globals => ['$dbh', '%session']);
sub handler {
my $r = shift; # Apache request object
my $status;
return $ah->handle_request($r);
}
Any ideas?
Thank you
Ogden
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users