4

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');
Ashley Wrench
  • 969
  • 8
  • 25

1 Answers1

9

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
code-8
  • 54,650
  • 106
  • 352
  • 604
  • Yes I have! I have updated. But Like i said, if it was file size, laravel would of spitted the PHP error like it has done when I have uploaded larger files. – Ashley Wrench May 05 '15 at 13:52
  • Can we see how do you declare your routes ? Update that on your post, I'll see what I can do. – code-8 May 05 '15 at 13:54
  • This was the fix. I did change the values, but in the wrong php.ini (I use Mamp in windows, and to be able to run laravel, I had to install php 5.5.19) I laterforgot that the php.ini file was located somehwere else -.- – Ashley Wrench May 05 '15 at 14:18
  • After restarting my computer because all else failed...it worked. I forgot that to use laravel I installed raw PHP on windows, and just ran artisan serv. Because I also used to use MAMP, I was updating the wrong php.ini Sorry for wasting your guys time -.- But thanks for the response! This was the fix in the end!!! – Ashley Wrench May 05 '15 at 14:21
  • I'm very glad I could help. – code-8 May 05 '15 at 14:29
  • This solution helped me a lot. thank you so much. I really appreciate it. – Sura Watthanalamlert Jan 04 '16 at 14:18