PHP-公共/存储中的Laravel 404

PHP-公共/存储中的Laravel 404,php,laravel,Php,Laravel,我正试图通过一个基本的HTTP get请求访问放置在公共存储中的文件。文件位于此处: www.example.com/doccenter/file.pdf 然而,当我尝试加载该页面时,我得到一个404错误-找不到页面 我试着跑: php artisan storage:link 但仍然不起作用。我已确认该文件确实存在: $ ~/example.com/storage/app/public/doccenter -ls 显示: file.pdf 我做错了什么?Per,php artisan

我正试图通过一个基本的HTTP get请求访问放置在公共存储中的文件。文件位于此处:

www.example.com/doccenter/file.pdf
然而,当我尝试加载该页面时,我得到一个404错误-找不到页面

我试着跑:

php artisan storage:link
但仍然不起作用。我已确认该文件确实存在:

$ ~/example.com/storage/app/public/doccenter -ls
显示:

file.pdf

我做错了什么?

Per,
php artisan storage:link
example.com/storage
上创建了一个指向
storage/app/public
的链接,因此您的文件可能位于
www.example.com/storage/doccenter/file.pdf
,我认为您传递了错误的路径,就像域.com/storage/your\u path\u diractoryAh一样,我没听清楚!在本地使用时,它将是
localhost/doccenter/file.pdf
。您的解决方案在远程计算机上运行!我会接受答案的,所以请允许我:-)谢谢!!