我設置一個形式,所以我可以上傳多個文件:無法上傳超過10個文件
<div>
<input type="hidden" name="MAX_FILE_SIZE" value="" id="MAX_FILE_SIZE">
<input type="hidden" name="UPLOAD_IDENTIFIER" value="" id="progress_key">
<input type="file" name="image[]" id="image-0">
</div>
該代碼將被克隆的onClick,所以我可以選擇多個文件。 問題是,當我嘗試上傳超過10個文件(例如20或30個文件)時,腳本就死了,當我打印$ _Files時,該數組只有10個項目。
Array
(
[image] => Array
(
[name] => Array
(
[0] => Nenufares.jpg
[1] => Nenufares.jpg
[2] => Nenufares.jpg
[3] => Nenufares.jpg
[4] => Nenufares.jpg
[5] => Nenufares.jpg
[6] => Nenufares.jpg
[7] => Nenufares.jpg
[8] => Nenufares.jpg
[9] => Nenufares.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/phpAKZxze
[1] => /tmp/phplRShGv
[2] => /tmp/phpJz64SW
[3] => /tmp/phpBkfMoz
[4] => /tmp/phpraMZBl
[5] => /tmp/phpeqaEgk
[6] => /tmp/phpVwxvFv
[7] => /tmp/phplvYiUS
[8] => /tmp/phpPGhqGr
[9] => /tmp/php5kMZca
)
[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] => 83794
[1] => 83794
[2] => 83794
[3] => 83794
[4] => 83794
[5] => 83794
[6] => 83794
[7] => 83794
[8] => 83794
[9] => 83794
)
)
我沒有與Zend的計數端的任何驗證,或者別的什麼,來阻止它..
切勿從客戶端發送最大文件大小。安全孔。 – Leri
嘗試:max_file_uploads(你需要在php.ini中做) – Dezigo
默認值是20,你必須在共享主機上。 – 472084