Try moving the {{ csrf_field() }} to just below the form tag. Sometimes, you get inconsistent taken matching if its not first....at least in the times I have had trouble.
Nov 21, 2016
4
Level 1
Laravel 5.3 TokenMismatchException
Hello guys. I have a simple form:
<form method='POST' action='/some/action' enctype='multipart/form-data'>
<input type="text" name="firstname" />
<input type="text" name="lastname" />
<input type="file" name="image-file" />
{{ csrf_field() }}
<input type="submit" name="submit" value="submit" />
</form>
When i post the fields (firstname, lastname) everything is ok. But if i choose also an image or any kind of file, i get error that TokenMismatch. How could i fix this ? Thanks!
Level 8
Yeah, I don't see how moving the field up is going to change anything (but it's pretty standard to have it first).
This is really a strange issue because you are saying that it's working without the file and you do have multipart set....
EDIT 1 :
AH okay, big files = need to check apache settings or whatever web server you are using for max_upload limit
1 like
Please or to participate in this conversation.