我正在尝试在Zend Framework 2上一次上传多个文件,但我收到以下错误:
Zend \ Validator \ Exception \ InvalidArgumentException
Value array must be in $_FILES format
/var/www/eiq/vendor/zendframework/zendframework/library/Zend/Validator/File/UploadFile.php
* @return bool
* @throws Exception\InvalidArgumentException
*/
public function isValid($value)
{
if (is_array($value)) {
if (!isset($value['tmp_name']) || !isset($value['name']) || !isset($value['error'])) {
throw new Exception\InvalidArgumentException(
'Value array must be in $_FILES format'
);
我主要跟踪ZF2 File Uploading - ReadTheDocs的最新文档,我的相关代码位于this gist。当我转储$ post数组时,它如下所示:
array (size=2)
'gallery' =>
array (size=1)
'file-upload' =>
array (size=3)
0 =>
array (size=5)
...
1 =>
array (size=5)
...
2 =>
array (size=5)
...
'submit' => string '' (length=0)
但是我可以'得到$post['file-input']
,它会给出同样的错误。任何人都可以请帮助