--- Zbigniew Lukasiak wrote:
I constantly bump into the mismatch in the treatment
of 'normal'
params and the file uploads.
Wouldn't life be simpler if
$c->request->param( 'file_field' )
would return a Catalyst::Request::Upload object (or
an array of them)?
You can get the name of the uploaded file from a
Catalyst::Request::Upload object.
--
Zbigniew Lukasiak
I also think about this a lot since I'm working mostly
on applications with lots of file uploading. You'd
still get a sort of mismatch though, but would be in
the type of thing that 'param' is returning.
In a way, with a POST everything is really an upload,
just that by convention if the type is urlencoded with
consider it a flat parameter list. But I think we
will need a more evolved way of thinking about this.
Work that's been done on the REST controllers suggest
a possible path. This way we can convert any type of
incoming POST into some sort of Perl object or List of
lists. Just need the correct de/inflators.
I like that Catalyst lets me easily separate
parameters extracted from a urlencoded body from
search query parameters. I do really use then for
separate things.
You could probably write a quick plugin to push upload
objects into the param list, but messing with that
list will probably result in it not being widely
accepted.
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid96545469