douzhang2092 2018-12-06 08:39
浏览 452
已采纳

如何在Lumen的浏览器中访问上传的文件

I can successfully upload files to the /storage/app folder but now I'm wondering how I can view these (image) files in the browser.

I've setup a symlink /public/storage that points to /storage/app

I'm trying to access the file through http://my-local-domain/storage/myphoto.jpg but it's giving me a NotFoundHttpException.

I know this works in Laravel, but not sure how to get this working in Lumen. Am I missing something?

Thanks.

  • 写回答

1条回答 默认 最新

  • dongsi4547 2018-12-06 08:56
    关注

    Sorry, my bad. My symlink was incorrect. I executed this command (my current path was the root of my application):

    ln -s storage/app public/storage
    

    This should be (complete paths):

    ln -s /var/www/storage/app /var/www/public/storage
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

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

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

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

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

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

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

客服 返回
顶部