我正在尝试将上传的文件读到我的系统,但我无法阅读它,因为每次我这样做都会收到此错误/proc/cpu/alignment
我不知道我在做错了什么。我正在使用FileNotFoundException in Filesystem.php line 41: File does not exist at path /var/www/html/..
方法。下面是代码。谢谢你的帮助
File::get()
答案 0 :(得分:0)
型号
public function setFileAttribute($file){
$this->attributes['file'] = Carbon::now()->second.$file->getClientOriginalName();
$name = Carbon::now()->second.$file->getClientOriginalName();
\Storage::disk('local')->put($name, \File::get($file));
}
<强> fileSystems.php 强>
'disks' => [
'local' => [
'driver' => 'local',
// 'root' => storage_path('public'),
'root' => public_path('storage'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('storage'),
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => 'your-key',
'secret' => 'your-secret',
'region' => 'your-region',
'bucket' => 'your-bucket',
],
],