I use this method to upload image and save it to a folder i created in the server :
public ActionResult Create(Regional regional, HttpPostedFileBase صورة)
{
if (ModelState.IsValid)
{
if (صورة != null)
{
صورة.SaveAs(Path.Combine(Server.MapPath("~/1"), صورة.FileName));
regional.صورة = صورة.FileName;
}
db.Regionals.Add(regional);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(regional);
}
and the input is :
<input type="file" id="صورة" name="صورة" accept="image/*" >
But The problem is when i press submit, the name of the image is saved in Database but the picture is not saved to the sever, i can't find it in the folder that i created which is named "1"
please any help