Hi,

I'm trying to handle multiple file uploads with a binded array.

// FilesType
$builder
    ->add('photo1', 'file', array(type' => 'file'))
    ->add('photo2', 'file', array('type' => 'file'))
    ->add('photo3', 'file', array('type' => 'file'))
;

// controller
$files = array(
    'photo1' => null,
    'photo2' => null,
    'photo3' => null,
);

$form = $this->createForm(new FilesType(), $files);
if ('POST' == $request->getMethod()) {
    $form->bindRequest($request);  // Throws an error
}

This actually throws an error from DataTransformer : "The key "file" should 
be empty or instance of File"

That should work, no ? I'm not sure what i'm doing wrong.

Any idea ?


Thanks,
Benjamin.

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to