How should I go about handling http uploads that exceeds the post_max_size
in a sane manner?
In my configuration post_max_size
is a few MB larger than upload_max_filesize
The problems I'm having are:
If a user uploads a file exceeding post_max_size
- The _POST array is empty
- The _FILES array is empty, and of course any error codes therein are not present.
- No other info what kind of form post it is is accessible through theses means.
Part of the problem is that the receiving script takes different actions depending on the contents of the POST.
I do have access to the _SERVER
variables and can get clues as to what happened, i.e. CONTENT_TYPE
, CONTENT_LENGTH
and REQUEST_METHOD
. It does however seem very problematic to make guesses based on those contents.
MEMORY_LIMIT (set to 10 times the relevant sizes) and Apaches LimitRequestBody (set to unlimited) are found to not be at fault.
As it stands now I have a hard time even providing any meaningful messages to the user.
Is there any way to retain some form data to get better clues as to what has gone wrong? I'm very reluctant to move away from php.