将图像存储在数据库中还是系统文件中?
问题描述:
完全重复: 用户图像:数据库或文件系统存储?
完全重复: 在数据库中存储图像:是或否?
完全重复: 我应该将我的图像存储在数据库中还是文件夹中?
完全重复: 您会将二进制数据存储在数据库或文件夹中吗?
完全重复: 将图片存储为文件或网络应用程序的数据库?
完全重复: 存储少量图像:blob 还是 fs?
我必须存储用户的个人资料图片 (100px * 100px) 什么是最好的存储方式?数据库或系统文件?哪个更好、更快、更安全......?
I have to store user's profile image (100px * 100px) what is the best way to store it ? database or system file ? which one is better , faster ,safer ... ?
答
总是 将图像、音乐文件等存储在磁盘上的系统文件中,然后将它们的 url:s 存储在数据库中.这样就可以了
Always store images, music files etc in system files on disk, and then store the url:s to them in the database. That will make it
1) 更快
2) 更容易配置安全设置
2) easier to configure security settings
3) 在我能想象到的任何方面都更好
3) better in any ways I can imagine