dongsigan2636 2018-11-01 05:51
浏览 33
已采纳

PHP - Laravel 404在公共/存储中

I am trying to access a file placed in my public storage with a basic HTTP get request. The file is located here:

www.example.com/doccenter/file.pdf

However, when I try to load that page I get a 404 Error - Not Found page.

I have tried to run:

php artisan storage:link

But still not working. I have validated that the file does indeed exist:

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

shows:

file.pdf

What am I doing wrong here?

  • 写回答

1条回答 默认 最新

  • dtrvzd1171 2018-11-01 05:54
    关注

    Per the docs, php artisan storage:link creates a link to storage/app/public at example.com/storage, so your file is likely at www.example.com/storage/doccenter/file.pdf.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部