文件附件和数据库的最佳实践 [英] Best Practice With File attachment and Database

查看:116
本文介绍了文件附件和数据库的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在将Access 2007数据库转换为asp.net + sql server 2008
数据库.
我们正在Access 2007中使用超链接类型字段.

将文件上传到服务器并在sql server 2008中进行跟踪以备将来下载或查看图片的最佳做法是什么?


谢谢

Hi,

I am converting a access 2007 database to a asp.net + sql server 2008
database.
We are using the hyper link type field in access 2007.

What is the best practice to upload a file to a server and keeping track of it in a sql server 2008 for future download or view for picture?


Thanks

推荐答案

这并不是真正的最佳实践,它取决于许多因素.文件的大小是多少?是否有必要将所有内容放在一起?您需要缓存吗?

如果文件很小,那么将它们存储在数据库中可能还不错.如果要经常访问文件(例如图像),那么将它们存储在服务器上并将路径存储在数据库中会更好.如果您需要将应用程序传输到不同的机器,那么将所有内容都存储在数据库中就可以轻松地跟踪那么多文件.
There isn''t really a best practice for this, it depends on a number of factors. What size are the files? Is it necessary to keep everything together? Do you need caching?

If the files are small, then storing them in the database may not be bad. If the files are going to be accessed frequently, such as images, then storing them on a server and storing the path in the database would be better. If you need to transport the application to different machines, then having everything in the database is easier to keep track of then many files.


这篇关于文件附件和数据库的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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