Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Exayne's avatar

TokenMismatchException when uploading Gif or MP4

Hello, I'm pretty new to Laravel. I have a page for editing the current user's avatar. It works well if I chose a jpg or png file.

My form validation rules for the file is "Image", so I should be able to upload a gif, right ? The rule works because if I upload a php file, I just get the validation error message.

But when I chose a gif file, I got the "TokenMismatchException" error. And I tried with a MP4 file, which is not an image file (http://laravel.com/docs/5.1/validation#rule-image ) and I still have the "TokenMismatchException" error, not the validation error.

I have my "_token" input in my form, and tried to clear cookies.

Can someone explains me what is wrong ?

0 likes
1 reply
Exayne's avatar
Exayne
OP
Best Answer
Level 1

Problem solved by changing "post_max_size" in php.ini. Hope it will help someone.

1 like

Please or to participate in this conversation.