如何限制一个目录中查看文件 [英] How to restrict viewing files within a directory

查看:136
本文介绍了如何限制一个目录中查看文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含许多敏感的PDF文档的目录。如果有人知道文件名,就可以简单地绕过我的登录系统并查看文件,就好像它是一个图像。

I have a directory that contains many sensitive pdf documents. If someone knew the filename, they could simply bypass my login system and view the file just as if it were an image.

如果我感动的目录出来的文档根我怎么会显示给用户,一旦他们在已记录的?我需要拉的pool回文档根目录,但不知道如何做到这一点。

If I moved the directory out of the document root how would I show it to the user once they were logged in? I'd need to pull the requested file back into the document root but not sure how to do this.

如果有任何其他建议除了从根删除目录,我接受这一点。谢谢你。

If there are any other suggestions aside from removing the directory from the root, I'm open to that as well. Thanks.

推荐答案

通过PHP即成文件,所以你将永远知道谁/何时/什么会下载。

Serve file through PHP so you will always know who/when/what will download.

这篇关于如何限制一个目录中查看文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆