I'm getting the following PHP error when attempting to upload a file that is too large:
POST Content-Length of 1034425027 bytes exceeds the limit of 33554432 bytes in Unknown
But I have the following set in my controller:
$config['max_size'] = '10000';
All the solutions I see involve increasing post_max_size
etc… but I don't want to allow larger files to be uploaded - I want an error, just the CI one, not a PHP one I can do nothing with.
Any ideas? Is this just a flaw in PHP? I'd rather not process the 'false' return in the ajax as a file upload error, because technically that could be produced from any server error.
EDIT; To clarify, as I'm getting requests for code that won't shed any light on anything (I can only assume the question is being misunderstood):
If the file is between 10mb (the limit set by CI) and 32mb (the limit set by post_max_size) everything works fine - there is no code issue. But if the file is large than 32mb PHP catches the file before CI can parse it and provide me with proper errors, so I have no chance to properly flag large files unless I make post_max_size infinitely large - which seems both dangerous and flawed. I'm wondering if there's a way around this. Ideally I don't need the server to get involved until after the CI validation, as I'd rather flag a user friendly error than the POST to just die.