我们可以将上传的文件保存到数据库中吗?
问题描述:
我想保存上传的数据.即我使用文件上传控件.
是否可以将上传的文件直接保存到数据库中?怎么办?我该怎么办?
请帮助我
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.