perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bart Duchesne <>
Subject Apache::Request - SSL - multipart/form-data - Failure
Date Tue, 01 Jun 2004 07:53:35 GMT
Hi all,

I'm trying to get file uploads working again in my modperl2 application 
(previously a modper1 application that worked like a charm).

Using Apache 2.0.49, Modperl 1.99_10, perl 5.8.1

I'm using the CVS version of libapreq2 (Apache::Request), because 
earlier versions (2.02 etc) gave a segmentation fault trying to access 
the Apache::Request->upload functions..

This is my handler:

package ui::html::ToolHandler;

use strict;

use Apache2;
use Apache::Const qw(:common REDIRECT);
use Apache::RequestRec;

use Apache::Request;
use Apache::Cookie;

sub handler {
        my $r = shift;
        my $q = Apache::Request->new($r, TEMP_DIR => '/tmp');
        my %cookies = Apache::Cookie->fetch($r);
        my $sessionid = exists $cookies{'AGSESSIONID'} ? 

        return OK if $r->header_only;

        my %params = ();
        foreach my $key (keys %{$q->param}) {
                my @val = $q->param( $key );
                print "param $key value ".join(',',@val)."<br>\n";         }

print "<HR>\n";

        my @uploads = $q->upload;
        print "uploaded fields '".join(',',@uploads)."'<br>\n";
        my $upload = $q->upload('f_field_backupRestore');
        if( $upload ) {
                print("upload ".$upload->filename."\n");

<FORM method="POST" enctype="multipart/form-data">
Field1 <INPUT type='text' name='textfield1'><BR>
Field2 <INPUT type='text' name='textfield2'><BR>
File <INPUT type='file' name='filefield'><BR>
<INPUT type="submit" value="Save"><BR>
        return OK;


Rather Basic code in my opinion.

Runs well in NON HTTPS server ; gives me correct file and parameter 
contents; however when the same code is run in an HTTPS server it 
doesn't work at all; most of the time the parameters are empty or non 

I have run a similar program using CGI under modperl2 and there it works 
correctly using HTTP or HTTPS .

This is that program:


package ui::html::ToolHandler;
use strict;

use Apache2;
use Apache::Response;
use CGI;

sub handler
my $q = new CGI;

print $q->header,
        $q->start_html('Upload test'),

if( my $fh = $q->upload('filefield')) {
        while( <$fh> ) {
                print ;




Is this a bug in Apache::Request or am I doing something terribly wrong 
here ?



aXs GUARD has completed security and anti-virus checks on this e-mail

Report problems:
Mail list info:
List etiquette:

View raw message