上传视频时,VerifyCsrfToken.php 67行中的TokenMismatchException [英] TokenMismatchException in VerifyCsrfToken.php line 67 when uploading video

查看:107
本文介绍了上传视频时,VerifyCsrfToken.php 67行中的TokenMismatchException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

图片2表单

图片3表单

尝试使用Laravel 5.2上传视频时,出现标题中提到的错误.

I'm getting the error mentioned in the title when trying to upload a video using Laravel 5.2.

图像正常工作.

我已经检查了MAMP服务器的PHP.ini设置.

I've checked the PHP.ini settings of my MAMP server.

我正在使用表单外观,因此不必将令牌导入到表单中.

I'm using the form facade so I don't have to import token into my form.

我一无所知,有人建议它可能是什么吗?

I'm clueless, does anybody have suggestions what it might be?

<div class="container spark-screen">
    <div class="row">
        <div class="col-md-10 col-md-offset-1">
            <div class="panel panel-default">
                <div class="panel-heading">Bestand uploaden</div>

                <div class="panel-body">
                    {!! Form::open(
                        array(
                            'url' => 'uploads',
                            'class' => 'form',
                            'novalidate' => 'novalidate',
                            'files' => true)) !!}

                        @include('uploadspanel.create_form')

                    {!! Form::close() !!}
                </div>
            </div>
        </div>
    </div>
</div>

控制器:

public function store(UploadRequest $request){
    $extension = Input::file('file')->getClientOriginalExtension();
    $filename = rand(11111111, 99999999). '.' . $extension;
    Input::file('file')->move(
      base_path().'/public/files/uploads/', $filename
    );
    $approved = $request['approved'];
    $fullPath = '/public/files/uploads/' . $filename;
    $upload = new Uploads(array(
        'name' => $request['name'],
        'format' => $extension,
        'path' => $fullPath,
        'approved' => $approved,
    ));
    $upload->save();
    $uploads = Uploads::orderBy('approved')->get();
    return view('uploadspanel.index', compact('uploads'));
}

推荐答案

它与MAMP设置有关.当我回声php_info()时就知道了;

It had to do with MAMP settings. figured it out when i echo php_info();

然后在第6或7行遵循我的php.ini的路径 然后使用另一个编辑器再次更改输入,保存.

then on line 6 or 7 followed the path to my php.ini then changed the inputs again with another editor, saved it.

retart MAMP服务器

retart MAMP server

完成

这篇关于上传视频时,VerifyCsrfToken.php 67行中的TokenMismatchException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆