I'm coding in a mod_perl environment and using the Apache2::Request module to get posted data. This works fine, except for when I also use the Apache2::Request object also to upload a file/get the file's filehandle. If use the methods separately, there are no issues. However, if I use them both in the same subroutine, I get this error in my Apache log file:
[notice] child pid 27383 exit signal Segmentation fault (11)
Here is my code:
my $r = shift;
use Apache2::Request;
use Apache2::Upload;
my $req = Apache2::Request->new($r, POST_MAX => 10 * 1024 * 1024,DISABLE_UPLOADS => 0);
my $img_url = $req->param('url');
my $upload = $req->upload('files[]');
my $filename = $upload->filename;
my $upload_filehandle = $upload->fh;
my $file_size = $upload->size;
Apache2::Upload is included because it is used by Apache2::Request. Like I said, if I comment out either the line that begins with "my $img_url.." or the upload section, it works fine. However, if they are both present in the code, I get a 502 Proxy Error and that error in the apache log file.
Thanks in advance!
my @upl = $req->upload(); foreach my $uitem (@upl) { ... }
to check for what you actually receive in your POST requests ? – collapsar Jan 31 at 13:26