mvc 图片上传数据库
时间: 2015-01-04来源:开源中国
前景提要
HDC调试需求开发(15万预算),能者速来!>>>
在网上看到有个说转为2进制。
public ActionResult Edit( Product product, HttpPostedFileBase image) { if (ModelState.IsValid) { if (image != null ) { product.ImageType = image.ContentType; //获取图片类型 product.ImageData = new byte [image.ContentLength]; //新建一个长度等于图片大小的二进制地址 image.InputStream.Read(product.ImageData, 0 , image.ContentLength); //将image读取到ImageData中 用这个方法是不是只可以上一个模型里面的一个图片啊。加入一个模型里面有几个图案片格式的该泽呢么写呢? 我是新手。。求指教

科技资讯:

科技学院:

科技百科:

科技书籍:

网站大全:

软件大全:

热门排行