我不確定我的文件上傳的原因是什麼。它失敗並重新導回,但是不與錯誤。文件上傳重定向錯誤不顯示
控制器
public function updateLogo()
{
$inputs = Input::all();
$logo_path = Input::only('logo_path');
$cpe_mac = $inputs['cpe_mac'];
$rule = ['logo_path' => 'mimes:jpeg,bmp,png'];
$validator = Validator::make($logo_path, $rule);
if ($validator->fails()) {
return Redirect::to($cpe_mac.'/view-profile/')->withErrors($validator)->withInput();
} else {
.....
}
查看
{!! Form::open(array('url' => '/'.$cpe_mac.'/view-profile/logo/update', 'class' => 'form-horizontal', 'role' =>'form','id' => 'editLogo','file'=>true)) !!}
<input name="logo_path" type="file" required> <br><br>
<button class="btn btn-success btn-sm mr5" type="file"><i class="fa fa-user"></i> Update Logo</button>
{!! Form::hidden('cpe_mac', $cpe_mac)!!}
{{ csrf_field() }}
{!! Form::close();!!}
我是不是忘了什麼東西?