问题:可以选择多个图片,但上传时只能得到一个,求前辈指导,谢谢。代码如下:
服务端“
0) { echo "Error: " . $_FILES["file"]["error"] . "
"; } else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
"; echo "Stored in: " . $_FILES["file"]["tmp_name"]; } ?>
你服务端那边处理的有问题吧 能不能贴出来看看
<input type="file" name="file"
改成
<input type="file" name="file[]"
然后
$_FILES变量结构
Array ( [name] => Array ( [0] => foo.jpg [1] => bar.png ) [type] => Array ( [0] => image/jpeg [1] => image/png ) [tmp_name] => Array ( [0] => /tmp/phpYzdqkD [1] => /tmp/phpeEwEWG ) [error] => Array ( [0] => 0 [1] => 0 ) [size] => Array ( [0] => 123 [1] => 456 ) )
感觉是这样的
然后你js要不要改怎么改我么仔细看。。