3
我可以增加MVC控制器动作的ASP.NET请求的maxRequestLength吗?为MVC控制器动作增加maxRequestLength
我有一个接受文件的MVC控制器,它可以非常大。我增加了web.config中的maxRequestLength,但这是安全问题,对我来说,最好的解决方案将只有上传方法的请求长度增加。可能吗?
我试图
<location path="UploadFile">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
<httpRuntime maxRequestLength="2097151"/>
</system.web>
</location>
但它并没有帮助
谢谢。
怎么样设置从这个线程:http://stackoverflow.com/questions/492346/asp-net-mvc-and-httpruntime-executiontimeout/636609#636609?它只适用于executionTimeout而不适用于maxRequestLength? –
jwaliszko
2012-04-15 23:14:31
@JaroslawWaliszko我检查,它似乎工作:) – 2012-12-17 21:24:23