Currently when user uploads a photo the page says \"Warning: POST Content-Length of XXX bytes exceeds the limit of 21000000 bytes in Unknown on line 0\".
I
The question is
How to prevent Warning: POST Content-Length
the answer is, without edit any config value, put this code at the very start of the file that will receive the form to be processed:
<?php // here start your php file
ob_get_contents();
ob_end_clean();
That is. No more warning, as well anything else you do not want as output on your page. After, as suggested elsewhere you can decide what to do with:
if($_SERVER['REQUEST_METHOD'] == 'POST' && empty($_POST) && empty($_FILES) && $_SERVER['CONTENT_LENGTH'] > 0){ echo"WoW your file is too big!"; }
Maybe also chunk the file, if in another way you pass correct values about file to be processed by Php.
as explained here Warning: POST Content-Lenght ...