in reply to Re: mod_perl Apache::Request vs Apache->request
in thread mod_perl Apache::Request vs Apache->request
how can i do both? i know its possible without the upload scenario**-- listing 1----** package MyMod::Add; use strict; use warnings; sub handler { my $r = Apache->request; my %args = $r->args; &Add($r); } sub Add { my $r = shift; my %args = $r->args; ..... } **---listing 2----** package MyMod::Uploads; use strict; use warnings; use MyMod::Add; use LWP::Simple; use URI::Escape; sub handler { # Standard stuff, with added options... my $r = Apache::Request->new( shift, POST_MAX => 10 * 1024 * 1024, # in bytes, + so 10M DISABLE_UPLOADS => 0 ); if ($r->upload){ upload($r); } } sub upload { foreach my $upload ( $r->upload ) { ##parse upload &MyMod::Add::Add($r); } } **---listing 3---** in httpd.conf: <Location /add> SetHandler perl-script PerlHandler MyMod::Add </Location>
|
|---|