存储::移动给出“在路径:找不到文件". Laravel与Ubuntu
问题描述:
我想移动一些文件
Storage::move('posts/temp/'.$val,'photos/'.$post->id.'/'.$val);
但是它给了我
File not found at path: home/vagrant/Code/......
要寻找一些特殊的配置吗?顺便说一句,该文件确实位于未找到的路径.
is there some special configuration to look for? Btw, the file is indeed at the not found path.
答
您需要添加正在使用的disk()
详细信息,例如,如果您正在使用亚马逊s3
,则需要在移动之前添加disk('s3')
代码将是:
You need to add disk()
detail that you are using for example if you are using amazon s3
you need to add disk('s3')
before move so the code will be:
Storage::disk('s3')->move('posts/temp/'.$val,'photos/'.$post->id.'/'.$val);