存储和检索文件进出数据库 [英] Storing and retreiving for files into and out to a Database
本文介绍了存储和检索文件进出数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hallo Guys,
我想构建一个将word文档,pdf和其他文档存储到数据库中的应用程序。我不想保存它的路径。当需要doc时,首先我想从数据库中取出它,然后将其保存到磁盘中。
将doc文件存储到数据库中是否会对文档本身进行格式更改?
谢谢
Hallo Guys,
I want to build an app that stores for word document, pdf and other documents into a database. I don't want to save its path instead. When the doc is required, first I want to pull off it from the database and then save it into disk.
Does storing the doc file into a database brings a format change into the doc itself?
Thanks
推荐答案
不,只要你以正确的方式保存它。
如果您使用二进制列,并将文档作为参数传递(而不是尝试将其连接到命令字符串),那么它应该可以正常工作。 (VARCHAR列可能有效,但二进制文件可能更小,如果你不知道文件类型包含的内容,可能会阻止一些转换错误)
No, provided you save it the right way.
If you use a binary column, and pass the document as a parameter (rather than trying to concatenate it into the command string) then it should work fine. (A VARCHAR column may work, but a binary could be smaller, and may prevent some conversion errors if you don;t know what the file type contains)
这篇关于存储和检索文件进出数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文