Developing software in the Real World

Simple Zend_Form File Upload Example Revisited

I've been thinking about the Simple Zend_Form File Upload Example that I discussed last month. To recap, if you haven't read the comments, if the form fails to validate for some reason then you get a nasty error: Warning: htmlspecialchars() expects parameter 1 to be string, object given in /Users/rob/Sites/akrabat/Zend_Form_FileUpload_Example/lib/Zend/View/Abstract.php on line 786 Essentially, what is happening is that the App_Form_Element_File class that we wrote assigns the $_FILES array to the $value parameter for the… continue reading.

Simple Zend_Form File Upload Example

UPDATE: This is out of date. Nowadays, you want to use Zend_Form_Element_File. Zend Framework 1.5's Zend_Form component is missing support for the file input element as it is waiting on a file upload component to build upon. We're busy people, so we'll fake it… This is a super simple example showing how to do file uploads with Zend_Form in Zend Framework 1.5. I'm building on the Simple Zend_Form Example, so make sure you have read… continue reading.