Max file number can php upload at same time
This limit was added in PHP 5.3.1, to avoid a type of DOS attack: temporary files exhaustion.
Added "max_file_uploads" INI directive, which can be set to limit the number of file uploads per-request to 20 by default, to prevent possible DOS via temporary file exhaustion. (Ilia)
(changelog for PHP 5.3.1)
You can increase this limit by changing the max_file_uploads
directive.
only 20 images are uploaded
Your php.ini is restricting to max 20 POST elements. Change max_file_uploads=20
to higher value.
Laravel Multiple Uploading Only Inserts 20 into DB
You might need to change your PHP settings to allow for larger uploads. PHP has limits on file upload size, POST size etc
Go to : /etc/php5/fpm/php.ini
or /etc/php/7.0/fpm/php.ini
or if you are using Apache /etc/php/7.0/apache2/php.ini
and change these values.
post_max_size = 125M
upload_max_filesize = 100M
max_file_uploads = 20
to a higher value. where post_max_size
is the maximum size of an entire POST upload_max_filesize
is the max size of an individual size and max_file_uploads
is the maximum limit of files you can upload at a time.
HTML Input: uploading multiple files maxes at 20
I'm a bit confused by the 'wont upload more than 20' part... what are you basing this on? You're getting an error either way it seems.
Change your for loop to check for isset($image['name'][$i]) instead, and you will no longer get an error.
for($i = 0; isset($image['name'][$i]); $i++)
{
//code
}
As mentioned by yes123, you risk hitting the maximum POST size and should check php.ini.
Multiple file upload limit
In your php ini file, max_file_uploads shows maximum number of files allowed to be uploaded simultaneously. By default 20 files are allowed. Use below code to set maximum file upload limit.
ini_set('max_file_uploads',1000);
Related Topics
Prevent Direct Url Access to PHP File
New Csrf Token Per Request or Not
Symfony 2 Entitymanager Injection in Service
How to Solve Time Out in PHPmyadmin
Using the PHP Http_Accept_Language Server Variable
Best Practice: Import MySQL File in PHP; Split Queries
Include Files from Parent or Other Directory
How to Get Greenwich Mean Time in PHP
Run Cron Job on PHP Script, on Localhost in Windows
Mysqli Binding Params Using Call_User_Func_Array
Intl Extension PHP_Intl.Dll with Wamp
MySQL Diacritic Insensitive Search (Spanish Accents)
Output Is in Seconds. Convert to Hh:Mm:Ss Format in PHP
Getting Actual Value from PHP Simplexml Node
$_Files Field 'Tmp_Name' Has No Value on .Jpg File Extension