HTML脚本
<label class="form-control-label" for="image">Image</label>
<input type="file" id="image" name="image" class="form-control">
UploadController
$image = $request->file('image')->getClientOriginalName();
$storage = new StorageClient();
$bucket = $storage->bucket('packagesIcons');
$bucket->upload(
fopen($image, 'r'),
[
'predefinedAcl' => 'publicRead'
]
);
return back();
我一直试图将文件上传到Firebase中的项目中,但是它在 $ image
中始终显示空以空值调用成员函数getClientOriginalName()
有人可以帮助我正确上传吗,我被困在这里...