Music upload TokenMismatchException Hi, I would like to upload some music, my system works with the image file but with the music file I have this error : TokenMismatchException in VerifyCsrfToken.php
{!! Form::open(array( 'route' => 'admin.music.store', 'class' => 'form', 'novalidate' => 'novalidate', 'files' => true)) !!}
<input type="hidden" name="_token" value="{{ csrf_token() }}">
{!! Form::label('link', 'Music (.mp3)') !!}
{!! Form::file('link',['class' => 'form-control fileform']) !!}
<button type="submit" class="btn btn-primary btn-lg">Create</button>
{!! Form::close() !!}
I have had this error several times before..
It has been a combination of many factors, including:
A correct and valid APP_KEY
Correctly configured cookies
Having the correct cookie / token (this one is an easy browser refresh)
General tinkering and hoping.
However, looking quickly at your code you don't appear to be passing a value into the _token field
So, try:
<input type="hidden" name="_token" value="csrf_token()"> (With blade brackets)
instead of
<input type="hidden" name="_token" value="">
I solved the problem. I change the configuration of the php.ini file like that :
post_max_size = 4G
upload_max_filesize = 2G
Will you have an extra 2GB for normal POST data? Seems a bit high to me but it's up to you.
Please sign in or create an account to participate in this conversation.