[html-formfu] File element issues

Carl Franks fireartist at gmail.com
Fri Jan 11 15:46:18 GMT 2008


On 26/12/2007, Diego Kuperman <diego at freekeylabs.com> wrote:
> Hi!
>
> I'm having some issues when handling file elements, I'm using FormFu
> from Catalyst:
>
> * If I put the constraint "required" on a file field then
> form->submitted_and_valid is always false, but the form->param and
> $c->req->upload gave the file element ok!.
> My yml description looks like this (I stripped aditional fields)
>
> indicator: submit
> auto_fieldset: { legend : 'Song data' }
> elements:
>
>      - type: File
>        name: songfile
>        label: MP3/OGG File
>        constraints:
>          - Required
>
>      - type: Submit
>        name: submit
>        value: Save song
>
>
>
> * When I access to the file at the controller, taking the constraint out
> or not, it is ok, but I can't use all the methods available for
> Catalyst::Request:Upload objects.
> I looked on the source and figured out that what I get is a FormFu
> object that wrap the original and pass to it the messages, so it is
> possible to add more gateway methods into
> /HTML/FormFu/QueryType/Catalyst.pm to get access to all the methods
> provided by the wrapped object:

I'd previously not wanted to add these methods to QueryType::Catalyst
without also adding equivalent methods to QueryType::CGI and
QueryType::CGI::Simple
However, it's fair to say that most people probably only use formfu
under catalyst, so I've relented.

I'm going to send a new top-level message to the list about the
changes I've made, so that everyone catches it.

Cheers,
Carl



More information about the HTML-FormFu mailing list