Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If you upload a file to PHP that exceeds upload_max_filesize, does the upload terminate?

As in title.

I have a upload_max_filesize limit of 2meg, if I upload a 3meg file will it stop uploading after 2megs or carry on until the full 3megs have been uploaded before deciding it's too big?

like image 270
totallyNotLizards Avatar asked Oct 04 '11 08:10

totallyNotLizards


1 Answers

will it stop uploading after 2megs or carry on until the full 3megs have been uploaded before deciding it's too big?

The full 3 megs will be uploaded. The request is only then passed on to PHP, which will decide that it's too big.

The error flag will be populated as pointed out by @Steve.

IIRC, it's different if you hit Apache's LimitRequestBody size: The request will be terminated immediately upon hitting the limit and an error page displayed.

like image 70
Pekka Avatar answered Oct 13 '22 10:10

Pekka