albanx
albanx

Reputation: 6335

Max file number can php upload at same time

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?

Upvotes: 25

Views: 31419

Answers (5)

ayan
ayan

Reputation: 3

You need to update the max_file_uploads permission and upload_max_filesize in php.ini file.

You may add this line in php.ini file.

max_file_uploads=100
upload_max_filesize = 500M

Upvotes: -1

Artefacto
Artefacto

Reputation: 97815

This limit was added in PHP 5.2.12, to avoid a type of DOS attack: temporary files exhaustion.

Changelog of PHP 5.2.12:

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, identified by Bogdan Calin. (CVE-2009-4017, Ilia)

You can increase this limit by changing the max_file_uploads directive.

Upvotes: 50

ncs
ncs

Reputation: 454

see upload_max_filesize in php.ini

Upvotes: -4

shamittomar
shamittomar

Reputation: 46692

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.

Upvotes: 2

Piotr Müller
Piotr Müller

Reputation: 5548

I think that is not 20 limit fault, but php config post_max_size and upload_max_filesize or bad handling of your upload form. Can you show us a sample source of your form and handling ?

Upvotes: -1

Related Questions