I've checked out the other posts about this, mine seems to be unique for some reason
基本上,我要做的是将上传的照片存储在公共目录中,以便于访问,但是当我存储它们时,我试图将它们存储在用户特定的文件夹中,所以
/public/photos/$User->id/$filename.jpg
Right now I have Dropzone uploading the file, and I've added to my filesystem.php this statement
'public_uploads' => [
'driver' => 'local',
'root' => public_path(),
],
So in theory when I access that using
Storage::disk('public_uploads')
它应该检索到正确的路径
这是我的控制器
$User = User::find(Auth::user()->id);
$Photo = Request::file('photo');
Storage::disk('public_uploads')->put("photos/$User->id", $Photo);
Then I get this error from Laravel on upload
{message: "Impossible to create the root directory "/censoredfilesystem/public/Photos/1".",…}
No idea where the period is coming from and any help is greatly appreciated
谢谢大家!
- 扎克