Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to catch maxrequestlength errors

How to catch maxrequestlength errors

Scheduled Pinned Locked Moved ASP.NET
helpsysadminwindows-admintutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wombaticus
    wrote on last edited by
    #1

    Hello For the life of me I cannot find a way to catch maxrequestlength errors when, for excample, a form is posted back to the server containing a file upload that exceeds this limit. There *has* to be a way, but the error seems to occur before any server-side processing can occur. I've even tried setting up a global error page in IIS

    <system.webServer>
    <httpErrors errorMode="Custom">
    <remove statusCode="404" subStatusCode="-1" />
    <error statusCode="404" prefixLanguageFilePath="" path="/error.aspx" responseMode="ExecuteURL" />
    </httpErrors>
    </system.webServer>

    in web.config, but even this can't seem to catch this error in time. There has to be a simple solution to this common (?) problem... surely?

    B 1 Reply Last reply
    0
    • W Wombaticus

      Hello For the life of me I cannot find a way to catch maxrequestlength errors when, for excample, a form is posted back to the server containing a file upload that exceeds this limit. There *has* to be a way, but the error seems to occur before any server-side processing can occur. I've even tried setting up a global error page in IIS

      <system.webServer>
      <httpErrors errorMode="Custom">
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" prefixLanguageFilePath="" path="/error.aspx" responseMode="ExecuteURL" />
      </httpErrors>
      </system.webServer>

      in web.config, but even this can't seem to catch this error in time. There has to be a simple solution to this common (?) problem... surely?

      B Offline
      B Offline
      Blikkies
      wrote on last edited by
      #2

      You can try catching the error in your Global.asax file.

      W 1 Reply Last reply
      0
      • B Blikkies

        You can try catching the error in your Global.asax file.

        W Offline
        W Offline
        Wombaticus
        wrote on last edited by
        #3

        See - I told you it was simple! :doh:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups