我在多个字段上多次上传时遇到问题。我有 3 个文件上传字段。当我每个上传十个时。我没有收到一些文件。
HTML 代码
<input type="file" name="before[]" multiple>
<input type="file" name="during[]" multiple>
<input type="file" name="after[]" multiple>
当我 print_r($_FILES); 我得到如下输出
Array
(
[before] => Array
(
[name] => Array
(
[0] => loose_diamond.jpg
[1] => silver.jpg
[2] => loose_diamond.jpg
[3] => silver_ware.jpg
[4] => diamond.jpg
[5] => loose_diamond.jpg
[6] => diamond.jpg
[7] => loose_diamond.jpg
[8] => diamond.jpg
[9] => loose_diamond.jpg
)
[type] => Array
(
[0] => image/jpeg
[1] => image/jpeg
[2] => image/jpeg
[3] => image/jpeg
[4] => image/jpeg
[5] => image/jpeg
[6] => image/jpeg
[7] => image/jpeg
[8] => image/jpeg
[9] => image/jpeg
)
[tmp_name] => Array
(
[0] => /tmp/phpr1CABT
[1] => /tmp/phpEhK0Wk
[2] => /tmp/phpVq54jM
[3] => /tmp/phpan3pId
[4] => /tmp/phplXVb0G
[5] => /tmp/phpWWfyja
[6] => /tmp/php5zLcZD
[7] => /tmp/phpWZu4F7
[8] => /tmp/phpHk8VzB
[9] => /tmp/php4OQPI5
)
[error] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
[8] => 0
[9] => 0
)
[size] => Array
(
[0] => 6450
[1] => 6851
[2] => 6450
[3] => 7866
[4] => 6372
[5] => 6450
[6] => 6372
[7] => 6450
[8] => 6372
[9] => 6450
)
)
[during] => Array
(
[name] => Array
(
[0] => loose_diamond.jpg
[1] => silver.jpg
[2] => silver.jpg
[3] => silver_ware.jpg
[4] => silver_ware.jpg
[5] => watch.jpg
[6] => machinery.jpg
[7] => conis.jpg
[8] => silver_ware.jpg
[9] => machinery.jpg
)
[type] => Array
(
[0] => image/jpeg
[1] => image/jpeg
[2] => image/jpeg
[3] => image/jpeg
[4] => image/jpeg
[5] => image/jpeg
[6] => image/jpeg
[7] => image/jpeg
[8] => image/jpeg
[9] => image/jpeg
)
[tmp_name] => Array
(
[0] => /tmp/php3eBKVz
[1] => /tmp/phpk0GxK4
[2] => /tmp/phplPxWDz
[3] => /tmp/php2J8Ry4
[4] => /tmp/php5b8pwA
[5] => /tmp/phpU1UvZ6
[6] => /tmp/phpHP7zAD
[7] => /tmp/phpKpfZwa
[8] => /tmp/phpl9SHvH
[9] => /tmp/php693Gbf
)
[error] => Array
(
[0] => 0
[1] => 0
[2] => 0
[3] => 0
[4] => 0
[5] => 0
[6] => 0
[7] => 0
[8] => 0
[9] => 0
)
[size] => Array
(
[0] => 6450
[1] => 6851
[2] => 6851
[3] => 7866
[4] => 7866
[5] => 8119
[6] => 8173
[7] => 8789
[8] => 7866
[9] => 8173
)
)
[images[]] => Array
(
[name] => machinery.jpg
[type] => image/jpeg
[tmp_name] => /tmp/php693Gbf
[error] => 0
[size] => 8173
)
)
注意:当我每张上传 5 张图片时,它工作正常。