[Catalyst-dev] file upload bug - patch attached

Jonathan Rockway jon at jrock.us
Fri Nov 17 17:53:05 GMT 2006


On second thought, is there a reason why we're not blessing the
'filename'?  How can the app differentiate between a textfield with the
text 'filename' and an actual file named 'filename'?

Carl Franks wrote:
> If I submit a form containing both a textfield and a file-upload
> field, which both have the name 'foo' ...
> 
> With CGI.pm, $q->param('foo') gives me:
> [
>  'textfield value',
>  *blessed_filename,
> ]
> 
> With Catalyst, $c->req->param('foo') only gives:
> 'filename'
> 
> This is because uploads are processed after other parameters and
> stomps on existing values.
> The attached patch fixes it ( includes tests :)
> It would now return this:
> [
>  'textfield value',
>  'filename',
> ]
> 
> Carl

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;



More information about the Catalyst-dev mailing list