【发布时间】:2018-09-07 19:35:42
【问题描述】:
无论我更改我的 php.ini 并验证视频上传多少次,我总是从 Laravel 收到一个错误,说 PostTooLargeException。
这是在我的控制器中:
'video' => 'required|mimes:mp4,flv,wmv,avi,mov,qt|max:100000',
'city' =>'required',
这是表格:
{!!Form::open(array('route'=>'profile.store','class'=>'formform','files'=>'true','method'=>'POST','enctype' => 'multipart/form-data')) !!}
{{Form::text('city','',array('placeholder'=>'City and State','class'=>'form-control', 'size'=>'35px','height'=>'15px','id'=>'location-input','autocomplete'=>'off'))}}
{{Form::file('video',array('id'=>'file','class'=>'thefile'))}}
{{Form::submit('Submit', array('class'=>'btn btn-danger form-control','id'=>'submitty','style'=>' background:#F88B22;'))}}
{!!Form::close() !!}
这是我的路线:
Route::resource('profile','ProfileController',['except'=>'edit']);
Route::get('editlisting/{companyname}','ProfileController@edit');
【问题讨论】:
-
我认为最大验证规则不是以兆字节为单位的。
-
这里是您的解决方案tjd-studio.com/blog/article/…
-
调试
ValidatePostSize::handle():$max的值是多少? -
@JonasStaudenmeir 我想我现在明白了。但我有一个问题。 laravel 应该验证文件 'video' => 'required|mimes:mp4,flv,wmv,avi,mov,qt|max:100000',但它没有这样做,我只是不断收到 PostTooLargeException。我知道文件很大,但我验证了它。这里发生了什么?
-
文件有多大?