Controler
[HttpPost]
public ActionResult Index(Add_Book _books)
{
BusinessLayer booksBusinessLayer = new BusinessLayer();
//books file = new books();
//var book = new books();
receiving error at below line
var fileName = Path.GetFileName(_books.File.FileName);
//var fileName = book.File.FileName;
var path = Path.Combine(Server.MapPath("~/Osho_Images"), fileName);
book.File.SaveAs(path);
booksBusinessLayer.AddBooks(_books);
return View();
}
Modal
public class books
{
public string ID
{
get;
set;
}
public string ISBN
{
get;
set;
}
public string Book_Title
{
get;
set;
}
public string Book_Cat
{
get;
set;
}
public string Language
{
get;
set;
}
public string Book_Desc
{
get;
set;
}
public string Price
{
get;
set;
}
public string Book_Img
{
get;
set;
}
public HttpPostedFileBase File
{
get;
set;
}
public int Qty
{
get;
set;
}
public int Qty_Alert
{
get;
set;
}
}
Pleas provide the solution.