Search code examples
asp.netwebformsashx

Max message size over the wire?


I have a file input field that base64 encodes a selected image to be sent to my handler (IHttpHandler).

What is the maximum or how do I found out what the maximum request size I can send to my handler?

The file will not be larger than 500kB, but I dont' know if that is too big or not, and given the nature of base64 encoding, it inflates the filesize ~33%.

UPDATE: Thank you all for the helpful answers and comments!


Solution

  • The max request size is driven by a setting in web.config:

    <httpRuntime maxRequestLength="nnnn" />
    

    The default is 4MB.

    http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength(v=vs.100).aspx