Display custom error page when file upload exceeds allowed size in ASP.NET MVC

后端 未结 4 1146
鱼传尺愫
鱼传尺愫 2020-11-28 23:06

My main issue is that I want to display an custom error page when an uploaded file exceeds allowed size (maxRequestLength in web.config).

When the big file is upload

4条回答
  •  醉话见心
    2020-11-28 23:44

    You need to make a custom HttpHandler that will do this for you. ASP.NET will automatically kill the connection if the upload size is too large (as you found out).

提交回复
热议问题