If you upload a file in PHP that exceeds upload_max_filesize, does the download complete?

As in the title.

I have a upload_max_filesize 2meg restriction, if I upload a 3meg file, will it stop loading after 2megs or will it continue until the full 3megs are uploaded before deciding on this too big?

+6
source share
2 answers

will it stop loading after 2 months or will it continue until the full 3megs are loaded before deciding that it is too big?

The full 3 megabytes will be downloaded. The request is only then passed to PHP, which decides that it is too large.

The error flag will be populated as indicated by @Steve.

IIRC, it is different if you click LimitRequestBody Apache: the request will be immediately terminated after reaching the limit and an error page will be displayed.

+4
source

It won't even start. It will populate $ _FILES ['filename'] ['error'] with the constant UPLOAD_ERR_INI_SIZE.

http://www.php.net/manual/en/features.file-upload.errors.php

-2
source

Source: https://habr.com/ru/post/898572/


All Articles