public ActionResult AddDriver(Driver driver) { if (driver.DriverImage != null) { var binaryReader = new BinaryReader(driver.DriverImage.InputStream); driver.DImage = binaryReader.ReadBytes(driver.DriverImage.ContentLength); //driver.DImage = new byte[DriverImage.ContentLength]; //DriverImage.InputStream.Read(driver.DImage, 0, DriverImage.ContentLength); } ViewBag.Message = aTransportManager.AddDriver(driver); ViewBag.Drivers = aTransportManager.GetAllDrivers(); return(View()); }