我在多个字段上有多个上传的问题。我有3个文件上传字段。当我每个上传十个时。我没有得到一些文件。
<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张图片时,它可以正常工作。
答案 0 :(得分:2)
您需要在php.ini中设置upload_max_filesize
和post_max_size
的值:
; Maximum allowed size for uploaded files.
upload_max_filesize = 2048M //or as per your requirements
; Must be greater than or equal to upload_max_filesize
post_max_size = 2048M //or as per your requirements
修改php.ini文件后,需要重启HTTP服务器以使用新配置。
答案 1 :(得分:2)
在你的php.ini中,检查一下
; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20
答案 2 :(得分:0)
max_file_uploads
post_max_size
upload_max_filesize