草庐IT

getClientOriginalName

全部标签

php - 拉维尔 "File Upload Error Call to a member function getClientOriginalName() on a non-object"

全部。我正在尝试学习Laravel,并且正在努力上传图片。我收到以下错误:“在非对象上调用成员函数getClientOriginalName()”我正在使用这些包:"anahkiasen/former":"dev-master","intervention/image":"dev-master","intervention/imagecache":"2.*"使用SO后,我已验证以下内容不会导致上述错误:表单上的多部分/表单数据存在上传文件数据PHP.ini的max_filesize比这个小测试文件的大小要大得多我的表格是:UploadImage产生错误的代码是:$image=Input

php - 在非对象上调用成员函数 getClientOriginalName()

我正在尝试做一个图片uploader,但它总是给我这个错误CalltoamemberfunctiongetClientOriginalName()onanon-object这是我的代码Controller代码publicfunctionuploadImageProcess(){$destinatonPath='';$filename='';$file=Input::file('image');$destinationPath=public_path().'/assets/images/';$filename=str_random(6).'_'.$file->getClientOrigi

php - Laravel 获取文件名

我基本上只想得到一个文件的名称,我是这样得到的:$inputPdf=$request->file('input_pdf');如果我dd($inputPdf)它打印我null。 最佳答案 获取文件名,如文档中所述:YoumayaccessuploadedfilesthatareincludedwiththeIlluminate\Http\Requestinstanceusingthefilemethod.TheobjectreturnedbythefilemethodisaninstanceoftheSymfony\Component

php - Laravel 获取文件名

我基本上只想得到一个文件的名称,我是这样得到的:$inputPdf=$request->file('input_pdf');如果我dd($inputPdf)它打印我null。 最佳答案 获取文件名,如文档中所述:YoumayaccessuploadedfilesthatareincludedwiththeIlluminate\Http\Requestinstanceusingthefilemethod.TheobjectreturnedbythefilemethodisaninstanceoftheSymfony\Component