0
نمایش ارور 404 - File or directory not found
با سلام خدمت اساتید توسینسو؛ من میخوام یک فایل ویدئویی با استفاده از MVC آپلود کنم، همه چیز خوبه و مشکلی نیست، زمانی که حجم فایل من از یک مقداری بیشتر می شود با این ارور مواجه میشم:
کد های من
Code
[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"); }
2 پاسخ
1
سلام دوست عزیز ، امیدوارم لینک زیر راه حل مشکلتون باشه :
Code
https://docs.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-2.2#unexpected-not-found-error-with-iis
1
در فایل web.config کد زیر رو قرار بدید:
Code
<configuration> <system.web> <httpRuntime maxRequestLength="xxx" /> </system.web> </configuration>
xxx حجم فایل به KB