0
محدویت در حجم آپلود
سلام
من کدهای زیر را نوشته ام
public ActionResult Index(HttpPostedFileBase image) { if (image != null) { var uploadFile = new byte[image.InputStream.Length]; image.InputStream.Read(uploadFile, 0, uploadFile.Length); var ImageDB = new BrandPic() { Pic = uploadFile, PicId = Guid.NewGuid(), name = "a" }; db.BrandPics.Add(ImageDB); db.SaveChanges(); } return View(); }
و در Web.config هم کد زیر را نوشته ام
<httpRuntime targetFramework="4.7" maxRequestLength="20971520" executionTimeout="3600"/>
اما هنگام اپلود فایل بالای30 مگ به ارور زیر برمیخورم اما می خواهم کاربر با تا یک گیگ را بتواند آپلود کند
باید چکار کنم
HTTP Error 404.13 - Not Found
The request filtering module is configured to deny a request that exceeds the request content length.
1 پاسخ
0
<httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="1600" requestLengthDiskThreshold="2147483647"/>
maxRequestLength="2147483647"
requestLengthDiskThreshold="2147483647
این دوتا مقدار به اندازه 1 گیگ حساب کنید و جایگزین کنید