TokenMismatchException when uploading a Video?

2019-02-24 07:01发布

When uploading a image, laravel goes through everything fine and dandy. No dramas. as soon as I upload a video file, nope. Pops up with:.

TokenMismatchException in VerifyCsrfToken.php line 46:

I have a valdiator:

$fileVali = \Validator::make(

    ['file' => \Input::file('media')],
    ['file' => 'required|image']

            );

here is the blade form:

{!! Form::open(array('method' => 'post', 'url' => '/post', 'class' => 'uk-form uk-width-1-1', 'files' => true)) !!}
{!! Form::text('post', NULL , array('class' => 'uk-form-blank uk-form-large', 'placeholder' => 'Whats Up ' . Session::get('user') . '?')) !!}
{!! Form::file('media' , '', array('enctype' => 'multipart/form-data')) !!}
{!! Form::close() !!}

Update: I have found that the issue is popping up because I'm uploading quite a large video file (65mb). Laravel had a issue with file size before but didn't pop back with validation errors!!anyone know what is going on?

Update 2: The Return Of The Update

Ok, so my route:

Route::post('/post', 'FeedController@create');

标签: php laravel-5
1条回答
倾城 Initia
2楼-- · 2019-02-24 07:26

According to your update, you said, "Laravel had a issue with file size".

If that the case, I don't think is Laravel. It's your PHP configuration.

Have you update these directives in your php.ini file to fit your need.

upload_max_filesize = 100M
post_max_size = 100M
查看更多
登录 后发表回答