So far this is what I know to be the way to pass the data from a post into the form.
$form->setData( $this->getRequest()->getPost() );
I thought that this might work
$form
->setData( $this->getRequest()->getPost() )
->setData( $this->getRequest()->getFiles() );
Which it does not. Looking through the framework source I confirmed that it shouldn’t. So I was thinking about merging the file data into post data. Surely this cannot be the desired solution? It’s not as if getPost() and getFiles() return easily mergeable arrays, they return Parameter objects.
Please note this is Zend Framework 2 specific.
Have you tried
getFileInfoknowing now or paying mind to the fact that your using Zend. Typically on a per file basis$_FILEis an array based on the information of the file being uploaded. Filename, extension, etc.. ZendsgetFileInfooutputs that information in a similar fashion. Though I haven’t played with it in sometime, its worth looking intoExample concept (more for multiple file uploads I know, but works with one, good concept to leave in tact just incase you wanna add a second or more files down the road)