Upload doesn’t work right when the file is too big

As per the PHP docs, error code 1 is UPLOAD_ERR_INI_SIZE: “The uploaded file exceeds the upload_max_filesize directive in php.ini”

You need to make sure all the following variables are properly set:

upload_max_filesize – max size of any individual file in an upload
max_file_uploads – total number of files allowed to be uploaded
post_max_size – sum total of all data being POSTed (form data + files)
memory_limit – must be > post_max_size, to allow space for PHP + script overhead

And on top of that, there’s the web server limits as well. Apache’s got LimitRequestBody which would apply long before PHP ever enters the picture.

Leave a Comment