Когда я пытаюсь загрузить более 20 файлов за раз, веб-сервер видит только первую 20. Любые другие файлы просто игнорируются. В чем проблема?
Простой код для проверки:
<form action="index.php" method="post" enctype="multipart/form-data">
<?php
if($_FILES){
print_r($_FILES);
}
else{
for($i = 0; $i < 30; $i++)
{
echo '<input type="file" name="file'.$i.'"><br/>';
}
}
?>
<input type="submit" value="go">
</form>
print_r()
вывод:
Array ( [file0] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpD42.tmp [error] => 0 [size] => 274217 ) [file1] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpD52.tmp [error] => 0 [size] => 274217 ) [file2] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpD73.tmp [error] => 0 [size] => 274217 ) [file3] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpD83.tmp [error] => 0 [size] => 274217 ) [file4] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpD94.tmp [error] => 0 [size] => 274217 ) [file5] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpDB4.tmp [error] => 0 [size] => 274217 ) [file6] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpDC5.tmp [error] => 0 [size] => 274217 ) [file7] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpDE5.tmp [error] => 0 [size] => 274217 ) [file8] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpDF5.tmp [error] => 0 [size] => 274217 ) [file9] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpE06.tmp [error] => 0 [size] => 274217 ) [file10] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpE26.tmp [error] => 0 [size] => 274217 ) [file11] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpE37.tmp [error] => 0 [size] => 274217 ) [file12] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpE57.tmp [error] => 0 [size] => 274217 ) [file13] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpE68.tmp [error] => 0 [size] => 274217 ) [file14] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpE78.tmp [error] => 0 [size] => 274217 ) [file15] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpE98.tmp [error] => 0 [size] => 274217 ) [file16] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpEB9.tmp [error] => 0 [size] => 274217 ) [file17] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpEC9.tmp [error] => 0 [size] => 274217 ) [file18] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpEE9.tmp [error] => 0 [size] => 274217 ) [file19] => Array ( [name] => 39442.jpg [type] => image/jpeg [tmp_name] => W:\tmp\phpEFA.tmp [error] => 0 [size] => 274217 ) )
.htaccess: php_value max_file_uploads 100 - не помогает
ini_set('max_file_uploads', 100) - doesn't help
Я только что добавил строку к php.ini на моем локальном сервере:
max_file_uploads = 100
И это помогло. Но я не думаю, что хост-менеджер меняет его на клиентском веб-сервере. Было бы очень круто повлиять на это значение без редактирования php.ini
.