bencarter78@hotmail.com's avatar

MethodNotAllowedHttpException thrown when uploaded file is larger than upload_max_filesize

Hello

I have a form which uploads a document to my site. On my dev environment my php.ini file has an upload_max_filesize of 2MB. If I try to upload a file which is 17MG, I get a very strange error...

MethodNotAllowedHttpException in RouteCollection.php line 218:

If I upload a 1MB file then it works fine.

Inspecting the request method when it fails says it is "POST" but when the 1MB file is uploaded it says "PUT".

I've tried a 'file' validation method but if the file is over php.ini's limit then I seem to always get the MethodNotAllowedHttpException.

Any ideas why this might be happening?

0 likes
1 reply
PovilasKorop's avatar

Probably after failure you get redirected to some other URL with not allowed method.

Inspect Network calls in browser development tools and look for redirects like 302 or something.

Please or to participate in this conversation.