我们可以将上传的文件保存到数据库中吗? [英] can we save the uploaded file into database ?

查看:365
本文介绍了我们可以将上传的文件保存到数据库中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想保存上传的数据.即我使用文件上传控件.
是否可以将上传的文件直接保存到数据库中?怎么办?我该怎么办?

请帮助我

i want to save data which is uploaded. i.e i use file upload control.
is this is possible to direcly save uploaded file into database?how?what can i do for that?

please help me

推荐答案

我今天刚刚回答了类似的问题.

看这个.
哪种方式最好将图像存储在sql服务器数据库 [ ^ ]
I just answered a similar question today.

Look at this.
which way is best to store image in sql server database[^]


最好将文件路径存储在数据库中,并将文件存储在服务器的一个临时文件夹中,高效...

您可以将上传的文件保存到数据库中.
It is better to store the file path in database and store the file in one temporary folder in server which is efficient...

You can save uploaded file into DB.


您不能直接将其保存为AFAIK,但这并不难:在数据库中设置一个Image字段,然后将文件上传控件具有 FileBytes属性 [ ^ ]您可以通过参数化查询直接写.
You can''t directly save it AFAIK, but it isn''t too difficult: set up an Image field in your database, and the file upload control has a FileBytes property[^] you can directly write in via a parametrized query.


这篇关于我们可以将上传的文件保存到数据库中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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