我试图将登录名,密码和图片从html5表单发送到asp.net mvc4控制器。我能够在该控制器中获取登录名和密码值。如何获得图片并保存到数据库?
html表格-
jQuery Ajax提交-
var data = $('#login-form').serialize(); var url = $('#login-form').attr('action'); $.post(url, data, function (response) { //some code here }
控制器-
[HttpPost] public JsonResult Index(FormCollection data) { String userName = data["username"]; String userPassword = data["password"]; //I want to get that picture here }
请提出建议。