【发布时间】:2018-08-11 08:42:37
【问题描述】:
我上传图片的代码如下:
$file = $file->move($path, $fileName);
代码有效
但我想使用 Storage::put 更改它,就像这个参考:
https://laravel.com/docs/5.6/filesystem#storing-files
我尝试这样:
Storage::put($fileName, $path);
没有用
我很困惑,我必须将$file 放在代码上
我该如何解决这个问题?
更新:
$file = file of image
$path = storage_path('/app/public/product/')
$fileName = chelsea.jpg
所以我想将名为 chelsea.jpg 的文件保存到 /app/public/product/
【问题讨论】:
标签: laravel filesystems storage image-uploading laravel-5.6