如何从数据库mysql保存和读取图像

问题描述:

你好,

iam使用asp.net 3.0和mvc3使用实体建模器.如何在数据库中创建图像类型为blob的条目

例如:我要上传按钮将图像保存到数据库并从数据库中显示

Helo ,

iam using asp.net 3.0 and mvc3 utilizing the entity modeler.How do i create an entry that is an image whith type blob in the database

For ex:I want upload button to save image to the database and display from the database

不要将图像直接保存到数据库中不是很好的做法,而是保存在应用程序本身中,在应用程序路径中创建一个文件夹.文件夹路径和文件名应保存在数据库中.

即:在应用程序中创建"Image"名称(如文件夹),然后浏览图像并保存在服务器驱动器自身中.文件路径应保存在数据库中.
Don''t save image directly to Database its not good practice ,instead save in application itself,make a folder in application path.Folder path and file name should save in database.

ie: in application create "Image" name like folder ,and you brows from image and save on server drive its self.File path should save on database .