perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: File uploads using Apache:;request in mod_perl2
Date Sat, 17 Jan 2004 02:03:55 GMT
Joe Schaefer wrote:
> Geoffrey Young <geoff@modperlcookbook.org> 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
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


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


Mime
View raw message