[html-formfu] Formfu inflator error

mohanprasad mohan at thebizmo.com
Tue Mar 17 19:12:07 GMT 2009


Hello everybody,
i have written a form with the following elements for testing inflator
feature in formfu. But when i tried to upload the image , form submittion is
failing, i am getting the "Error opening image file" error

yml form is as follows.

elements:
    - type: File
      name: image
      label: Upload image
      attributes:
        title: Browse and upload image
      inflators:
        - type: Imager
    - type: Submit
      name: submit
      value: Upload

Controller actions for handling it is as follows.
# start of controller action
sub image :Chained('base') Args('0') FormConfig {
    my ($self, $c) = @_;
    my $form = $c->stash->{form};

    if ($form->submitted_and_valid) {
        $c->log->info("form submitted and valid");
        my $image = $form->param_value('image');
        # do some stuff here
        $c->stash->{success_msg} = "Your new avatar uploaded successfully";
        $c->stash->{template} = 'image_success.tt';
    }else{
        $c->log->info('form submission failed');
        $c->stash->{template} = 'image.tt';
    }
}
# end of controller action

Form submission is always failing for any type of image.
Could anybody let me know where i am doing wrong?
thanks in advance.
Best Regards,
Mohan
-- 
View this message in context: http://n2.nabble.com/Formfu-inflator-error-tp2493255p2493255.html
Sent from the HTML-FormFu mailing list archive at Nabble.com.




More information about the HTML-FormFu mailing list