[Html-widget] RFC Handling uploads, WAS uploads in the results object?

John Napiorkowski jjn1056 at yahoo.com
Wed Nov 15 19:35:29 GMT 2006


[snip]

Here's the tactic I'm taking with this.  If making
this work with Catalyst is the most important thing
than it's unnecessary to have both upload and query
accessors for the form object, as well as redundent to
do:

$w->process( $query, $uploads)

Since $query has to be an object with a param method
that works like CGI.pm, that is $query->param returns
an array of field names that you can get values for
via $query->param(xxx).  Because if $query is
$c->request you get both param and upload methods.

So we can simple say "$w->process( $query )" and from
there load up both the post parameters AND any
uploaded files.

my @post_params = $c->request->param;
my @uploads     = $c->request->upload;

The main diff here is that $c->request->param(param)
returns a scalar whereas $c->request->upload(upload)
returns a catalyst::request::upload object.  This is
good because we immediately get the All constraint
working if we combine this two.  I've been testing
this and I don't see if breaking anything, so I'll
submit a patch and some tests and see what you all
think.

--john






 
____________________________________________________________________________________
Sponsored Link

Rates near historic lows - 
$200,000 mortgage for $660/ month - 
http://yahoo.ratemarketplace.com


 
____________________________________________________________________________________
Sponsored Link

Online degrees - find the right program to advance your career.
Www.nextag.com



More information about the Html-widget mailing list