perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: File uploads using Apache:;request in mod_perl2
Date Sat, 17 Jan 2004 02:03:55 GMT
Joe Schaefer wrote:
> Geoffrey Young <> writes:
> [...]
>>I'm not as familiar with brigades as I should be, but does
>>it save you the iteration process or is it just a substitute for
>>reading to a buffer? 
> It'd save you the iteration process (it's an APR::Brigade method,
> not APR::Bucket), but would not destroy the buckets within the 
> brigade (hmm, does APR::Brigade have a DESTROY method?).  
> The advantage here is you'd be able to accomplish this
> in one or two lines of perl, ie.
>   my $upload_data = $req->upload('file')->bb->flatten;

It doesn't sound like a good idea. Users ain't need to mess with bucket 
brigades, unless they really want to. If the upload is always going through 
the temp file, why making things complex for the users?

In any case it's the best to hide the internals behind an API, so you can do:

my $upload_data = $req->upload('file')->slurp;

and inside slurp you have the C API to do anything you need. How does that sound?

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

Reporting bugs:
Mail list info:

View raw message