我的 Laravel 项目中有一个图片上传表单。
我想将上传的图像保存到public/images/位置。
但图像上传到public/app/images位置。
这app是从哪里来的!!
配置/文件系统.php
'disks' => [
'local' => [
'driver' => 'local',
'root' => public_path(''),
],
'public' => [
'driver' => 'local',
'root' => public_path(''),
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => 'your-key',
'secret' => 'your-secret',
'region' => 'your-region',
'bucket' => 'your-bucket',
],
],
控制器
if($this->request->hasFile('photo'))
{
$image_url = $this->request->photo->store('/images/campaign/large');
$image = substr($image_url, strrpos($image_url, '/') + 1);
}
我在本地项目中应用了相同的代码。图片上传到了正确的位置。
但是这个问题发生在我的 cPanel 服务器项目中。我已经在实时服务器中清除了现金。
错误在哪里?
翻阅古今
潇湘沐