Maximum Request Length Exceeded Not Redirect on Error Page

前端 未结 1 1294
不知归路
不知归路 2021-01-27 02:45

I followed these links:

  1. Catching "Maximum request length exceeded" and
  2. ASP.NET - how to show a error page when uploading big file (Maximum requ
相关标签:
1条回答
  • 2021-01-27 03:10

    You can add

     <httpErrors errorMode="Custom" existingResponse="Replace">
      <remove statusCode="404" subStatusCode="13" />
      <error statusCode="404" subStatusCode="13" prefixLanguageFilePath="" path="http://localhost:1899/ErrorUpload.aspx" responseMode="Redirect" />
    </httpErrors>
    

    just after

    <security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="5000000" />
      </requestFiltering>
    </security>
    

    where you redirect to a Error Page...

    0 讨论(0)
提交回复
热议问题