我在控制器中有一个功能
public function upload(Request $request)
{
$file = $request->file('File');
$destinationPath = 'uploads';
$file->move($destinationPath,$file->getClientOriginalName());
}
如果我在日志中发送 $request 它会显示类似这样的内容
array (
'_id' => 'tuYDOc644W6DDgAS',
'_token' => 'FerVRJvJWtnzv91TGuFRpIeT173aD9pH2o9Pqcu9',
'upload_column' => 'File',
'id' => 'WU_FILE_0',
'name' => '134772132_217259409961521_6013657189083751736_o.jpg',
'type' => 'image/jpeg',
'lastModifiedDate' => '2/7/2021, 6:44:12 AM',
'size' => '629882',
'_file_' =>
Illuminate\Http\UploadedFile::__set_state(array(
'test' => false,
'originalName' => '134772132_217259409961521_6013657189083751736_o.jpg',
'mimeType' => 'image/jpeg',
'error' => 0,
'hashName' => NULL,
)),
)
但这给出了“在 null 上调用成员函数 move()”
我正在使用laravel-admin 包,如何正确保存文件并获取有关文件的信息?