如何在mvc中上传数据库中的图像 [英] how to upload image in database in mvc
本文介绍了如何在mvc中上传数据库中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的名字没有和个人资料图片插入到数据库中
我怎样才能一次性插入数据库
将图像转换为字节
i have name no and profile pic to insetrt into database
how can i insert all at a time into database
converting the image into bytes
推荐答案
请通过以下链接来帮助您:
How-to-upload-and-display-image-in-mvc/ [<一个href =http://www.c-sharpcorner.com/UploadFile/b696c4/how-to-upload-and-display-image-in-mvc/\"target =_ blanktitle =New Window> ^ ]
ASP.NET MVC upload-image-to-database-and-show-image-dynamic-using-a-view / [ ^ ]
Upload-image-in-database-mvc [ ^ ]
Please go through below links that will help you:
How-to-upload-and-display-image-in-mvc/[^]
ASP.NET MVC upload-image-to-database-and-show-image-dynamically-using-a-view/[^]
Upload-image-in-database-mvc[^]
在此处阅读我之前的解决方案:
如何制作Mvc图像上传系统 [ ^ ]
将图像转换为字节[]:
C#Image to Byte Array和Byte Array to Image Converter Class [ ^ ] br />
-KR
Read my previous solution here:
How Do I Make Mvc Image Upload System[^]
And for converting Image to Byte[]:
C# Image to Byte Array and Byte Array to Image Converter Class[^]
-KR
公共ActionResult注册(FormCollec ing obj_frmRegistration,HttpPostedFileBase upload)
{
注册objc = newRegistration();
objc.AdminName = obj_frmRegistration [AdminName];
objc.Gender = obj_frmRegistration [性别];
objc.typ = obj_frmRegistration [typ];
objc.CompanyName = obj_frmRegistration [CompanyName];
objc.img = obj_frmRegistration [CompanyName];
}
public ActionResult Registration(FormCollection obj_frmRegistration, HttpPostedFileBase upload)
{
Registration objc = newRegistration();
objc.AdminName = obj_frmRegistration["AdminName"];
objc.Gender = obj_frmRegistration["Gender"];
objc.typ= obj_frmRegistration["typ"];
objc.CompanyName = obj_frmRegistration["CompanyName"];
objc.img=obj_frmRegistration["CompanyName"];
}
这篇关于如何在mvc中上传数据库中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文