在Web服务器中存储文件的安全方式? [英] Secure way to store files in web server?

查看:209
本文介绍了在Web服务器中存储文件的安全方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的文件在Web服务器中是安全的.只有经过身份验证的用户才能访问这些文件,才能访问这些文件.我曾考虑将文件存储为"Long BLOB",但它最多仅支持2MB的数据.文件大小可能超过50MB.还有其他更好的方法来保护文件吗?请帮助我.谢谢.

I want my files to be secure in my web server. Only authenticated users to access those files should be able to access those files. I thought of storing files in database as "Long BLOB" but it supports only upto 2MB of data. The file size may exceed beyond 50MB. is there any other better way to secure the files? please help me.thanks in advance.

推荐答案

不要将它们存储在数据库中.将它们放在您的Web目录中,并使用 .htaccess 对其进行保护.

Don't store them in a database. Put them in your web directory and secure them using .htaccess.

如果要通过其他方式进行身份验证,则将文件存储在无法通过Web访问但可由用户php读取的目录中.

If you want to authenticate via other means, then store the files in a directory that isn't web-accessible but is readable by the user php runs as.

这篇关于在Web服务器中存储文件的安全方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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