I'd like to change the maxAllowedContentLength for a specific method of a controller. I've been able to set it at the controller level, but can't figure out the syntax for the method. I'm not sure if this is possible. So the relevant section of my web.config file looks like:
<location path="Controllers/MyController.cs">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="52428800" />
</requestFiltering>
</security>
</system.webServer>
</location>
My method inside Controllers/MyController.cs looks something like:
public async Task<JsonResult> MyUpload() {
//Do stuff here
}
location
element is really only used for actual files and directories.[RequestSizeLimit(1234)]
on the controller action.