I want to add the ability to upload an image and save it in my database. I have a table and one of its columns is an Image data type. I followed this link, and some similar links, but it doesn't seem to work. Here is the code I tried:
if (Request.Files.Count > 0 && Request.Files[0] != null)
{
HttpPostedFileBase file = Request.Files[0];
var path = Path.Combine(Server.MapPath("~/App_Data/uploads"), file.FileName);
file.SaveAs(path);
}
But the file doesn't save in the specified folder.