多文件上传器仅发送一个文件 [英] Multiple file uploader only sends one file
本文介绍了多文件上传器仅发送一个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有多个文件输入,可以选择多个文件,但是当我在表单操作页面上var_dump文件变量时,只有一个文件.
I have a multiple file input which I'm able to select multiple files but when I var_dump the file variable on the form action page there's only ever one file.
<input id="image" type="file" name="images" multiple="multiple">
这是转储var_dump($_FILES);
array(1) { ["images"]=> array(5) { ["name"]=> string(12) "IMG_4511.JPG" ["type"]=> string(10) "image/jpeg" ["tmp_name"]=> string(26) "/private/var/tmp/php8g7CV3" ["error"]=> int(0) ["size"]=> int(730250) } }
以下是开幕表格标签:
<form enctype="multipart/form-data" method="POST" action="http://localhost.com/item/update" accept-charset="UTF-8">
这里有什么我想念的吗?
Is there anything I'm missing here?
推荐答案
<input id="image" type="file" name="images[]" multiple="multiple">
应该工作
这篇关于多文件上传器仅发送一个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文