File upload MethodNotAllowedHttpException
Hi Folks any help appreciated.
Summary: Uploading large files redirects with an error page with
MethodNotAllowedHttpException in RouteCollection.php line 218:
For files less than 2mb everything is fine and can be processed For files less than 8mb the form submits in the normal fashion and behaves as expected. For files equal to and greater than 8mb I get the MethodNotAllowedHttpException, the url is no longer the expected one. It should be co.uk/item/1/edit but i get co.uk/item/1 the Request Method: POST
Form: `
<input type="hidden" name="MAX_FILE_SIZE" value="2097152">
`
The route
Route::resource('/item', 'ItemController');
The Controller is a resource. I get this error if the controller method is empty or performing tasks
public function update(Request $request, $id) { return redirect()->action('ItemController@edit', ['id' => $id]); }
Any thoughts?
Okay this is what i have so far.
In app/Http/Kernel I have found and added the following to the global $middleware
'\Illuminate\Foundation\Http\Middleware\VerifyPostSize::class,'
Great news i know get a "PostTooLargeException" error and still loose the put/patch header
I've not done anything with custom exceptions and the Exception Handler so I need to read up and try to figure out how to catch and redirect back to the /edit or /create pages
Please or to participate in this conversation.