Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TokenMismatchException when uploading a Video?

Tags:

php

laravel-5

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');
like image 415
Ashley Wrench Avatar asked Jan 09 '23 10:01

Ashley Wrench


1 Answers

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
like image 166
code-8 Avatar answered Jan 16 '23 18:01

code-8