Hi,
I'm new to the forum (just registered today, in fact) but I did try searching for the information I'm looking for before posting. Here's my question:
Where does the PHP Warning originate that warns when the size of POST data exceeds the value set in php.ini? This error seems to be thrown before the page is loaded and therefore seems difficult (if not impossible) to trap or prevent from displaying.
As an example of what I mean, I tried completely preventing errors from displaying by using "error_reporting(0);" That worked fine for other errors but when data was submitted on a form which exceeded the 8M set in the php.ini file, the error appears despite this function at the top of the page to which the form data is sent.
I notice that the error itself references "Unknown" as the file name so I suspect this error is being generated prior to the script even running at all.
Essentially, what I am trying to do is detect if the POST data exceeds the php.ini limit and display a more user friendly error than the PHP Warning. My users are likely to upload files approaching the limit so I need to be able to give them a message that the file they tried is too big.
I discovered that adding the hidden form field MAX_FILE_SIZE and setting the value lower than the post_max_size value does nothing since this would only be evaluated if the POST data could be read. Instead the entire $_POST array seems to be discarded when it exceeds the post_max_size.
I have done multiple searches on this topic in this forum and in other PHP forums and mostly what I found is advice to increase the setting in php.ini but this is not an option for me.
Surely, others have run into this and found a solution.
And suggestions?