Is php.ini upload_max_filesize combined? – Stack Overflow

I can confirm that upload_max_filesize is the maximum size for a single file.

e.g. with upload_max_filesize=2M, you can upload 3 files of 1.5M.

I just confirmed this by testing.

Limits you should care about:

  • upload_max_filesize (default 2M): max size per individual file;
  • max_file_uploads (default 20): max number of files you can send per request;
  • post_max_size (default 8M): max raw POST data size per request;
    post_max_size must be greater than the sum of the sizes of:
    • all uploaded files
    • all data in other POST fields
    • a few extra KB to account for the multipart/form-data overhead (headers/boundaries) that wrap every single file and every single POST field in the payload.

Be really careful with these limits, as PHP will not error if you exceed one of these limits; instead, you’ll end up with partial or empty $_POST or $_FILES and might have a hard time debugging the issue.

For example, max_file_uploads will silently ignore any file past the nth uploaded file, and you’ll end up with a truncated list of files with no warning whatsoever.

Facebook Comments


(Visited 1 times, 1 visits today)