Error in multipart forms in symfony

By Nacho Martín on 09 October 2009

When $form->bind() throws this error:

This form is multipart, which means you need to supply a files array as the bind() method second argument.

It means that at least one field in the form is multipart. That means that the form contains files. That’s why bind needs a second argument, usually with the form $request->getFiles($form->getName());

    $this->form->bind($request->getParameter($this->form->getName()), $request->getFiles($this->form->getName()));

Written by @nacmartin

blog comments powered by Disqus