Zendcasts Forum

A community of developers who work with the Zend Framework and other enterprise PHP technologies

You are not logged in.

#1 2009-10-28 15:30:31

alessio
Member
Registered: 2009-08-07
Posts: 27

file field not request

I have a form with a file field, press SEND and when loading the controller for the recovery of field can not retrieve the file field why?


$request = $this->getRequest();
$result = $request->getPost();
Zend_Debug::dump($result);

//where file field???

Offline

#2 2009-10-30 15:52:50

Jon
Administrator
Registered: 2009-06-27
Posts: 5

Re: file field not request

you need to setup the form to accept multiple mimetypes:
$form = new Zend_Form();
$form->setAttrib('enctype', 'multipart/form-data');

also, if I remember correctly, getPost(); will not include stuff from the $_FILES PHP namespace. You can get around this with a little hack though:

        $_POST = array_merge($_POST, $_FILES);

or just access $_FILES directly

Offline

Board footer

Powered by FluxBB