FileExtension validor error in Form context #3389

neilime opened this Issue Jan 9, 2013 · 3 comments

4 participants


Error append when validating a form wich contains Zend\Form\Element\File with File\Extension validator.

$form = new \Zend\Form\Form();
    'name' => 'test_file_input',
    'type'  => 'Zend\Form\Element\File'

$inputFilter = new \Zend\InputFilter\InputFilter();
'name' => 'test_file_input',
'required' => true,
'validators' => array(
      'name' => 'File\Extension',
      'options' => array('extension' => 'mo')

//Fake datas for test
$_FILES = array(
    'test_file_input' => array(
    'name'  => '',
        'type'   => 'text',
        'size'   => 200,
        'tmp_name' => '/home/tmp/phpZiL4GG',
        'error' => 0

$form->isValid(); // Error : stream_resolve_include_path() expects parameter 1 to be string, array given
Zend Framework member

Which branch does this occur against -- master or develop? If master, can you please test against develop, as there have been a number of changes there in the past month? If it's against develop, I'll see what I can do.


Using the develop branch, you likely need to ensure that you are using type Zend\InputFilter\FileInput for your 'test_file_input' input specification. It is required for the file input filters/validators to work.

'name' => 'test_file_input',
'type'     => 'Zend\InputFilter\FileInput',

@neilime let me know if that doesn't fix it - I'll try to help and reproduce on my end.


Yes it works with the develop branch.

@Maks3w Maks3w closed this Jan 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment