dragon_9000 2017-11-30 11:47
浏览 153

Laravel:阻止从公用文件夹直接访问文件

I am stuck on this part of my laravel application, Where I am asked to protect the files from directly accessed via url browser hit. I have a public folder in which in a doc folder is present where all the documents are going to be uploaded. I just need a solution to prevent this where i can access docs directly from my application but any third party visitor can not view my docs (images,pdfs etc..).

I have tried many solutions but its not at all working. I just want to things :- 1. Protect my docs through direct access. 2. Way of implementing it in laravel (via .htaccess)

I know this can be possible through htaccess, but how? Kindly help Please :)

  • 写回答

2条回答 默认 最新

  • doumei8258 2017-11-30 11:52
    关注

    Add in your upload folder .htaccess file with content:

    Deny from  all
    
    评论

报告相同问题?

悬赏问题

  • ¥20 易康econgnition精度验证
  • ¥15 线程问题判断多次进入
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致