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