Я могу успешно загрузить файл с помощью MVC, но когда файл становится немного лучше, я столкнулся со следующей ошибкой:
HTTP Error 404- File or Directory not found
Это мои коды:
[HttpPost]
public ActionResult SubmitProductCatTizer(MZPDB.ProductCatTizer model, long proCatId, HttpPostedFileBase file)
{
if (ModelState.IsValid)
{
if (file == null)
return RedirectToAction("AddProductCatTizer");
var guid = Guid.NewGuid().ToString("N");
var fullPath = Server.MapPath("~/Uploaded/" + guid + ".mp4");
file.SaveAs(fullPath);
Dbcontex.ProductCatTizers.Add(new MZPDB.ProductCatTizer()
{
Title = model.Title,
Description = model.Description,
ProductCatId = proCatId,
VideoFile = guid,
Status = true
});
Dbcontex.SaveChanges();
return RedirectToAction("ListProductCatTizer", "ListAdmin", new { area = "AdminPanel" });
}
return View("AddProductCatTizer");
}