Unfortunately I discovered recently that if post_max_size was triggered then php just totally wipes out both $_POST and $_FILE globals and seems to pass absolutely no errors back to the script making it totally impossible to determine if someone keeps trying to upload massive files eating into my bandwidth.
Heres what I found from the php manual:
If the size of post data is greater than post_max_size, the $_POST and $_FILES superglobals are empty. This can be tracked in various ways, e.g. by passing the $_GET variable to the script processing the data, i.e. <form action="edit.php?processed=1">, and then checking if $_GET['processed'] is set.Their suggested method of tracking the event is not useful to me as a legit user could get punished if they somehow accidentally put this query string into their URL.
I noticed though that if post_max_size is exceeded then it gets recorded in the php.log, so php must be outputting something.
Sorry if my post has been a bit long winded but any suggestions on how I can detect if post_max_size was triggered?