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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With