Created
January 9, 2013 12:06
-
-
Save sasezaki/4492643 to your computer and use it in GitHub Desktop.
ZF2 InputFilter Upload's Filter decalation by scalar (not method calling)
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 | |
| // @see https://github.com/cgmartin/ZF2FileUploadExamples/blob/master/src/ZF2FileUploadExamples/Form/SingleUpload.php | |
| $inputFilter = new InputFilter\InputFilter(); | |
| $file = array( | |
| 'type' => 'Zend\InputFilter\FileInput', | |
| 'name' => 'file', | |
| 'required' => FALSE, | |
| 'filters' => array( | |
| array( | |
| 'name' => 'filerenameupload', | |
| 'options' => [ | |
| 'target' => './data/tmpuploads/', | |
| 'overwrite' => true, | |
| 'use_upload_name' => false, | |
| 'randomize' => true] | |
| ) | |
| ) | |
| ); | |
| $inputFilter->add($file); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment