Is it possible to increase the maxRequestLength of an ASP.NET request for an MVC controller action?
I have an MVC controller that accepts a file, and it can be very large. I increased maxRequestLength in web.config, but this is a security issue, and the best solution for me would be to increase the request length for the Upload method only. Is it possible?
I tried
<location path="UploadFile">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
<httpRuntime maxRequestLength="2097151"/>
</system.web>
</location>
But it did not help
Thank.
source
share