mod_perl on apache2 and file uploads

From: Volker Kroll (kroll_at_webgods.de)
Date: 10/27/03


Date: Mon, 27 Oct 2003 13:50:37 +0100

Hi,

I'm searched all the documentation to mod_perl for apache2 but
havn't found anything.
I'm looking for the possibility to use a upload to my mod_perl
application. In Apache1 I used:
sub handler {
        my $request = Apache::Request->new(
                  shift,
                  POST_MAX => 60 * 1024 * 1024, ## 24MB
                  DISABLE_UPLOADS => 0
        );
### more here
}

sub uploadFile {
        my $tempdir = shift;
        log_info("We are in upload");
        my $request = shift;
        $params = shift;
        my $file = $request->upload('ImageName');
        
        open FILE, ">$tempdir" . $filename
                or log_error("Error while opening ImageFile $!");
        my $fh = $file->fh;
        while (<$fh>) {
                print FILE $_;
        }
}

How can I get the same functionality in apache2?

Thanks in advance
Volker



Relevant Pages