0

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!

Josh
  • 1,019
  • 3
  • 17
  • 32
  • 1
    The max size is 4096kb(4mb). There is a config setting called maxRequestLength which can be used to adjust this. – AliK May 15 '13 at 22:17
  • @AliK Thanks. Could you check out the comment I posted on the answer below? – Josh May 15 '13 at 22:23
  • 1
    see [here](http://stackoverflow.com/questions/6327452/which-gets-priority-maxrequestlength-or-maxallowedcontentlength) – AliK May 15 '13 at 22:30

1 Answers1

1

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

nimeshjm
  • 1,665
  • 10
  • 13
  • May I ask why [this answer](http://stackoverflow.com/questions/15920985/generic-handler-parameter-size-limit?rq=1) says 30 million bytes is set by default, or that just for a different parameter? What is the difference between the 2 parameters? `maxRequestLength` and `maxAllowedContentLength` – Josh May 15 '13 at 22:20
  • 1
    @Josh maxRequestLength is ASP.NET specific, whereas maxAllowedContentLength is for all requests served by IIS, ASP.NET or not. – Xander May 15 '13 at 22:29
  • maxRequestLength is to set a limit to the full request message size in your .NET app. maxAllowedContentLength is for the content part of a request message in IIS. – nimeshjm May 15 '13 at 22:33