如何从数据库mysql保存和读取图像 [英] How to save and read image from database mysql

查看:89
本文介绍了如何从数据库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 .


这篇关于如何从数据库mysql保存和读取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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