我正在处理输入type="file" multiple="multiple"
和 PHP 上传循环。
<input name="data[]" id="file" type="file" multiple="multiple" class="txtinput2" />
上面是我的 HTML,下面是我的 PHP:
if(isset($_POST['action'])=='uploadfiles'){
$count_data=count($_FILES['data']) ; ######### count the data #####
for($x=0;$x<$count_data;$x++)
当我回显count_data
时,它给了我一个5的输出,但是当我选择28个文件时,它说在输入字段中选择了28个文件。multiple="multiple"
唯一支持5个上传吗?
我检查了 PHP 信息,它说最大文件上传20,最大帖子大小8m和最大文件大小128m,我尝试上传的所有文件的总大小为1.94 megs。
Array ( [name] => Array ( [0] => DSCF0960.jpg [1] => DSCF0961.jpg [2] => DSCF0963.jpg [3] => DSCF0964.jpg [4] => DSCF0966.jpg [5] => DSCF0967.jpg [6] => DSCF0968.jpg [7] => DSCF0969.jpg [8] => DSCF0970.jpg [9] => DSCF0971.jpg [10] => DSCF0972.jpg [11] => DSCF0973.jpg [12] => DSCF0974.jpg [13] => DSCF0975.jpg [14] => DSCF0976.jpg [15] => DSCF0977.jpg [16] => DSCF0978.jpg [17] => DSCF0979.jpg [18] => DSCF0980.jpg [19] => DSCF0981.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 [10] => image/jpeg [11] => image/jpeg [12] => image/jpeg [13] => image/jpeg [14] => image/jpeg [15] => image/jpeg [16] => image/jpeg [17] => image/jpeg [18] => image/jpeg [19] => image/jpeg ) [tmp_name] => Array ( [0] => /tmp/php4uI9g8 [1] => /tmp/phpVx5WrZ [2] => /tmp/php2DbRCQ [3] => /tmp/phpT2gSNH [4] => /tmp/phpPDlZYy [5] => /tmp/phpMzCcaq [6] => /tmp/phpRxkwlh [7] => /tmp/phpgoRWw8 [8] => /tmp/phpYlGsIZ [9] => /tmp/phpYBG1TQ [10] => /tmp/phpTQBD5H [11] => /tmp/phpQesphz [12] => /tmp/php5U4dtq [13] => /tmp/phpp2G5Eh [14] => /tmp/phpwaZZQ8 [15] => /tmp/php4W0W2Z [16] => /tmp/php7g3WeR [17] => /tmp/phpeZj0qI [18] => /tmp/phpAGo6Cz [19] => /tmp/phpbXlfPq ) [error] => Array ( [0] => 0 [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 [11] => 0 [12] => 0 [13] => 0 [14] => 0 [15] => 0 [16] => 0 [17] => 0 [18] => 0 [19] => 0 ) [size] => Array ( [0] => 79605 [1] => 75839 [2] => 71245 [3] => 63228 [4] => 64201 [5] => 74440 [6] => 75350 [7] => 73367 [8] => 72491 [9] => 69725 [10] => 75508 [11] => 72755 [12] => 76076 [13] => 72140 [14] => 68745 [15] => 77859 [16] => 74281 [17] => 74613 [18] => 71702 [19] => 75916 ) )