PDA

View Full Version : سوال: محدویت در حجم آپلود



Iran58
شنبه 08 اردیبهشت 1397, 17:01 عصر
سلام
من کدهای زیر را نوشته ام

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.

Moien Tajik
شنبه 08 اردیبهشت 1397, 22:19 عصر
https://stackoverflow.com/a/31730047/6661314