girish parganiha

girish parganiha

  • NA
  • 244
  • 17.5k

Asp.net MVC FileUpload

Oct 5 2018 12:54 PM

Hi,

I have a properties in my Item model class like FoodType,Price,Description,Amount,Image.

 
I have write HttpPostedFileBase File in my Item model class for image upload and change the Create .cshtml file to <input type="file" name="File" /> for image upload to database.
 

Can anyone help me how to write code for [HttpPost] Create action method.

 

FoodType is foreignkey one to many relationship.

 

My model Entitity connectionstring object is "FoodAppEntities db=new FoodAppEntities(); "

 
 

Thanks.


Answers (5)