Does anyone know if there is a way to catch this error?
In fact, I'm trying to implement some functions that allow the user to upload a file from a web page to the webapi controller.
This works fine, but if the file size exceeds the maximum size specified in the web.config file, the server returns a 404 error.
I want to be able to intercept this and return a 500 error along with a message that can be used by the client.
I canβt decide where to do this in WebApi, because the Application_Error method that I implemented in Global.asax never got in and it seems like IIS is not passing this WebApi application.
asp.net-web-api
llihp
source share