Created
May 9, 2012 14:37
-
-
Save Ocramius/2644954 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if (isset($_POST['strumento'][$cod_strum])) { | |
| $element = new Zend_Form_Element_File('foo'); | |
| $element->setLabel('Upload an image:') | |
| ->setDestination('/home/dbstrumenti'); | |
| // ensure only 1 file | |
| $element->addValidator('Count', false, 1); | |
| // limit to 100K | |
| $element->addValidator('Size', false, 102400); | |
| // only JPEG, PNG, and GIFs | |
| $element->addValidator('Extension', false, 'jpg,png,gif'); | |
| $form = new Zend_Form(); | |
| $form->setAttrib('enctype', 'multipart / form-data'); | |
| $form->addElement($element); //dall'esempio | |
| echo $form->render(); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment