Abhilash J A

Abhilash J A

  • 505
  • 2.4k
  • 601k

How can pass more than one file type in view to controller ?

Jan 24 2017 4:14 AM
Hello everyone,
 
In MVC 5, I have view contain 2 file type input control,
 
  1. @model Reboxwebapp.Models.ViewModel.PartnerVM

  2. @using (Html.BeginForm("Index", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))  

  3. Logo Image:    
  4.                                               
  5.  @Html.TextBoxFor(model => model.LogoImage, new { type = "file"id = "fileToUploadLogo" })
  6.                        
  7. Title Picture:
  8.  
  9.  @Html.TextBoxFor(model => model.TitlePictureImage, new { type = "file" , id = "fileToUploadTitle" })
  10.  
  11.   <input type="submit" value="OK" />  

 How can I pass each image to controller?
 
  1. [HttpPost]  
  2.       public ActionResult GetPartner(PartnerVM partnerVM, HttpPostedFileBase fileUpload)  
  3.       {  
  4. partnerBL.LogoImage = ??  
  5.  partnerBL.TitlePictureImage = ?? 
  6. }
 
 
Please help me...

Answers (1)