Welcome Guest, Not a member yet? Register   Sign In
Large file upload results in 403 error
#1

I am troubleshooting my file upload with no success. I have a form that is submitted via AJAX and if a user tries to upload a file that is larger than the upload_max_filesize setting codeigniter will throw a 403 error. Specifically:

PHP Code:
CodeIgniter\Security\Exceptions\SecurityExceptionThe action you requested is not allowed

Currently my max filesize is set to 8M and my file upload validation is at 4M. I am only handling small PDF files that should be no larger than 500KB. If the file supplied is smaller than the upload_max filesize (8M) setting but above what I have specified (4M) my code will handle the large file like it should and show the user an error message but anything above 8M results in the generic Codeigniter 403 error above. Since the exception is thrown before my handler even executes there is so far nothing I have found that I can do.

Realistically, there is no reason for someone to attempt to upload a 8M (or larger) file but I would like to be able to handle the error properly and show a "File is too large" message instead of showing a generic 403 error to the user. Is there anything I am missing or is this something that needs to be fixed in the Framework?
Reply


Messages In This Thread
Large file upload results in 403 error - by kyle - 02-23-2021, 01:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB