在非对象错误上调用成员函数getClientOriginalName()

时间:2014-07-23 16:40:13

标签: php laravel laravel-4

我不知道这有什么问题..我尝试过使用dd ..我只需要上传一个文件..每次我上传它总是返回null

控制器

public function postDoTest(){
     dd( Input::file('file') ); // this returns NULL
}

然后在我的视图

{{ Form::open( array( 'url' => 'files/do-test', 'files' => true, 'id' => 'file_uploader_forms' ) ) }}


{{ Form::file('file', array( 'id' => 'fileuploads', 'style' => 'display:none' ) ) }}

<button type="submit" id="upload_all" class="btn btn-upload">test</button>

{{ Form::close() }}

1 个答案:

答案 0 :(得分:1)

编辑:

您应该将'id' => 'fileuploads'更改为'id' => 'file'