我应该采取哪些安全措施来防止我的文档被下载?
我正在进行一个摄影师的项目。他获得了很多版权图像,并希望在带有水印的网站上显示或预览它们。他还希望为购买该特定图像的会员提供无水印的高质量原始图片下载。
我计划如下以防止未经授权的下载:
1.) 将所有没有水印的图像放在秘密文件夹中,并使用 .htaccess
阻止对其内容的访问 2.)要显示带有水印的图像,请使用preview.php文件调用它[从秘密文件中读取文件并添加水印并将其显示到浏览器]
3.) 要启用无水印下载,请使用 download.php 调用它,并在 download.php 中检查凭据,如果登录用户一切正常,则从秘密位置读取原始文件并将内容输出到浏览器。
我还应该采取其他安全措施吗?
I am with a project of a photographer. He got a lot of copyright images and want to show or preview them in a website with watermark over it. He also wants to enable download of good quality original picture without watermark of that picture to the members who paid for that specific images.
I am planning as following for preventing unauthorised download:
1.) placing all the images without the watermark in a secret folder and preventing access to its content using .htaccess
2.) to show image with watermark call it using preview.php file [read the file from secret file and add watermark and show it to browser]
3.) to enable download without watermark call it using download.php and inside download.php checking the credentials and if everything goes right with logged user then read the original file from secret location and output the content to browser.
Are there any other security measures that I should take?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
无需添加 .htaccess 文件,只需将该文件夹放在网站根目录之外即可。除此之外,听起来不错。
Instead of adding a .htaccess file, just put the folder outside of your websites root directory. Other than that, sounds good.
你在这里描述的听起来不错。我可能会将照片完全放在 webroot 之外,但这与
.htaccess
相比不会产生实际差异。What you are describing here sounds fine. I 'd probably put the photos entirely outside the webroot, but that shouldn't make a practical difference vs the
.htaccess
.您可以使用一种通常称为“热链接保护”的方法,通过该方法可以阻止使用非您自己站点的 HTTP 引荐来源网址的请求。 mod_rewrite 对此非常有用。这是一个例子:
You might use a method thats often called "hotlink protection" whereby you block requests with HTTP referers that are not your own site. mod_rewrite is very good for this. Here is an example: