管理数据库或文件系统中上传的文件? [英] manage uploaded files in database or file system?

查看:186
本文介绍了管理数据库或文件系统中上传的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将为我的用户添加功能,以上传小于2mb(jpg,gif,pdf和docs)的小文件。对于页面加载时间目的和通常在未来管理文件,你可以建议是最好的文件上传到文件系统(并通过数据库链接到它)或直接上传到数据库作为BLOB?

I'm going to incorporate the feature for my users to upload small files which are under 2mb (jpg, gif, pdf and docs). For page loading times purposes and generally managing files in future, can you recommend is it best to have the files uploaded to the filesystem (and link to it via the database) or upload to the database directly as a BLOB?

感谢任何帮助。 Dan

Thanks for any help. Dan

推荐答案

从我的角度来看,文件系统是最好的选择。

From my point of view, file system is the best choice.


  1. 您的数据库不会因BLOB字段而过大

  2. 您只将文件名存储为字符串,

  3. 如果您的空间不足,插入新硬盘比迁移您的数据库更容易。

这里唯一的缺点是,有人(甚至你)可能会比BLOB字段更容易意外删除文件。

The only drawback here is that someone (even you) can accidentally delete files much easier than BLOB fields.

这篇关于管理数据库或文件系统中上传的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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