【问题标题】:Call to a member function getClientOriginalName() on a non-object bug在非对象错误上调用成员函数 getClientOriginalName()
【发布时间】:2014-07-23 16:40:13
【问题描述】:

我不知道这有什么问题..我尝试使用 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() }}

【问题讨论】:

    标签: php laravel laravel-4


    【解决方案1】:

    编辑:

    您应该将'id' =&gt; 'fileuploads' 更改为'id' =&gt; 'file'

    【讨论】:

      猜你喜欢
      • 2013-12-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-11
      • 2016-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多