Hi All,
I have a doubt in the below code that I have tried the multi part/ form data in Web Config and Global.asax files and passed through controller but I am not getting the multipart data.
So is this the right way or there is an another way to pass the multi part / form data.
//Web Config.cs File
- config.Formatters.XmlFormatter.SupportedMediaTypes.Add(new System.Net.Http.Headers.MediaTypeHeaderValue("multipart/form-data"));
//Global.Asax File
- GlobalConfiguration.Configuration.Formatters.Add(new FormMultipartEncodedMediaTypeFormatter());
// Controller File
- var EmailId = HttpContext.Current.Request.Params["EmailId"];
- var MobileNo = HttpContext.Current.Request.Params["MobileNo"];
- var UserName = HttpContext.Current.Request.Params["UserName"];
- var Password = HttpContext.Current.Request.Params["Password"];
- var Address = HttpContext.Current.Request.Params["Address"];
- var IDProof = HttpContext.Current.Request.Params["IDProof"];
- var VendorPhoto = HttpContext.Current.Request.Files["VendorPhoto"];
If there's a solution please let me know it as soon as possible.