Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get file size of attempted upload when UPLOAD_ERR_INI_SIZE error occurs?

Is there any way to get file size of attempted upload when you get UPLOAD_ERR_INI_SIZE? That is when file being uploaded exceeded upload_max_filesize directive in php.ini.

like image 515
morphles Avatar asked Nov 17 '25 01:11

morphles


1 Answers

You may consider using $_SERVER['CONTENT_LENGTH']. It has some overhead and represents the total size of a POST request, but in some situations this will be acceptable.

like image 142
Jevgenij Evll Avatar answered Nov 19 '25 17:11

Jevgenij Evll



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!