Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max file number can php upload at same time

Tags:

I am using the tag for uploading multiple files with php. I notice that if i choose more than 20 files php uploads only the first 20 files.Is there a way to expand this limit?

like image 200
albanx Avatar asked Aug 25 '10 10:08

albanx


People also ask

What is the maximum file uploading limit in PHP?

The default PHP values are 2 MB for upload_max_filesize, and 8 MB for post_max_size.

Can we upload any file size in PHP?

By default, PHP has a limit set to 50 MB (megabytes) for uploading through PHP scripts on our servers. If you need a higher limit, you can usually change that through the php. ini file.


2 Answers

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.

like image 73
Artefacto Avatar answered Sep 18 '22 17:09

Artefacto


The size of total upload is limited and not the number of files. You can change the total size by editing this line in php.ini:

   post_max_size = 256M

Or more. So, if you want to upload 50 files, each of 100 MB, then you should set this limit more than 5000 MB.

like image 35
shamittomar Avatar answered Sep 21 '22 17:09

shamittomar