I am testing a HttpHandler that accepts XML. It works fine when a small amount of data is posted but if I post data larger then approx 29mb, I get a asp.net 404 Error. I am posting to the handler from another handler in the same project and I have tried 2 methods - 1. HttpWebRequest with "POST" 2. WebClient with UploadFile() and UploadData() I get the same 404 error when the posted data is above 28.6 MB. I also tried putting a breakpoint right in the beginning of the receiving handler and debugging. It is never hit. Appears like the handler was never called. Works ok for smaller sized data. I already have the following setting. What am I doing Wrong?
EDIT: I have also tried posting to a different handler that doesnt not consume posted data, just to test, but the results are the same. Environment: Win 7, IIS 7.5, .net 3.5, VS 2008 |
|||||||||||
|
I discovered that the problem is with IIS 7 and above. It requires the max request length to be set in a different place. See the following links - http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/Q_22943810.html http://msdn.microsoft.com/en-us/library/ms689462%28VS.90%29.aspx The default value is 30000000. which is 28.6mb. The correct way to set in web.config is -
This config cleared the error I was getting. I wish the errors reported were more descriptive, at least on local machines Does this mean that setting <httpRuntime maxRequestLength="1048576" /> is enough for IIS 6 ? (the live server is win2003) |
||||
|