Zend\Validator\File\Upload #4554

Closed
isimonov opened this Issue May 29, 2013 · 6 comments

Comments

Projects
None yet
5 participants

For any reason in attempt to load the file through Zend\Validator\File\Upload issues the message that the file isn't found (fileUploadErrorFileNotFound) if to rename attribute name="files" into anything another (for example name="file") everything perfectly works, validator doesn't return mistakes. I couldn't understand where exactly a mistake, but it takes place to be.

Contributor

ThaDafinser commented Jul 31, 2013

@Latch i've just tried this and changed my form element to:

<input type="file" value="" name="file">

and everything works like expected.

Can you show an example please? Or if this is solved already close this issue?

Member

Bittarman commented Jul 31, 2013

I would expect this to be because your form tag is missing the enctype="multipart/form-data" attribute. Please reopen with more complete code to reproduce if this is not the case.

@Bittarman Bittarman closed this Jul 31, 2013

I have a code for an example, I open a new issue?

@Bittarman Bittarman reopened this Jul 31, 2013

In view (version with error):

<form method="post" enctype="multipart/form-data">
    <input type="file" name="files" multiple="true">
    <input type="submit">
</form>

In controller action:

$adapter = new \Zend\File\Transfer\Adapter\Http();
if (!$adapter->isValid()) {
    \Zend\Debug\Debug::dump($adapter->getMessages());
}

Else in view input file name = file (not fileS) (version without error):

<form method="post" enctype="multipart/form-data">
    <input type="file" name="file" multiple="true">
    <input type="submit">
</form>

$adapter->isValid() return true, all valid, errors not found. Input file name attribute maybe different, all ok, but name "files" for any reason in attempt to load the file through Zend\Validator\File\Upload issues the message that the file isn't found (fileUploadErrorFileNotFound).

Can I do something wrong?..

Contributor

ThaDafinser commented Mar 7, 2014

@Latch cannot rebuild the issue anymore (seems to be fixed).

Member

adamlundrigan commented Oct 22, 2015

@Maks3w looks like this can be closed

@Maks3w Maks3w closed this Oct 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment