I too am having issues with file uploads using mod_perl2. I've gotten the beta of Apache::Request but it looks like from this thread that there's not yet a way to retrieve the uploaded file. Is this true?

Pete Smith wrote:

Hi,

I am new to this list, but I have tried looking through the docs at CPAN and
googling for people with similar problems to no avail.

We have upgraded our server to apache2 + mod_perl2. I used to have a routine
that took a file upload from a multipart form and handed it as a stream to
Imager and Image::Size like so:


my $image_upload = $r->upload('image'); my $file_handle = $image_upload->fh();

read ($file_handle, my $full_image_data, (stat($file_handle))[7]);

my $imager = Imager->new();

$imager->open(data => $full_image_data, type => 'jpeg');
my ($width) = imgsize(\$full_image_data);


I now know that I could pass the file handle to Imager and Image::Size instead of turning into a scalar stream, but that isn't the problem.

I have discovered that Apache::Request for mod_perl2 has changed the fh
method to bb, which apparently returns an APR::Brigade (object I presume)
instead of a file handle.


I have looked for documentation for APR::Brigade, but can find none. I have
no idea what it is!

Could somebody please point me in the right direction as to how I can
achieve the above in mod_perl2?

Thanks,
Pete




--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to