【发布时间】:2019-04-30 06:45:36
【问题描述】:
我的结构是这样的:
/laravelfiles
/public_html
--/demo
----/index.php (and other files inside public folder)
我已更改 index.php 以访问 /laravelfiles,一切正常。
我的配置文件系统:
'local' => [
'driver' => 'local',
'root' => public_path(),
],
'public' => [
'driver' => 'local',
'root' => public_path(),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
当我尝试存储文件时:
Storage::disk('public')->put($folder.'/'.$file_name, $file_data);
它存储在 laravelfiles/public 文件夹中。因为它是分开的,所以文件是不可访问的。
我想要的是将文件存储在 /public_html/demo 文件夹中(与 index.php 相同的文件夹)。
我该怎么做?
【问题讨论】: