iisproxy icon indicating copy to clipboard operation
iisproxy copied to clipboard

Fails on Large File Upload

Open GoogleCodeExporter opened this issue 9 years ago • 2 comments

I have an MVC web app running on Windows Server 2008 R2 IIS 7.5, ASP 4.0 (call 
it machine ‘B’).  A Windows 2003 IIS 6 (machine ‘A’) is running this 
‘IIS Reverse Proxy’ code.  The application works fine via the reverse proxy 
until I try to upload large image files (it works with small ones). It also 
works when I   When I try to upload a large file (6476 KB) the original code 
returns the error “The request was aborted: The request was canceled” on 
the line “output.Write(buffer, 0, read);” in the CopyStream method in 
‘ReverseProxy.cs’.  It appears to start failing on uploads of files greater 
than 4 MB.

When I try the change suggested in Issue 7 (related to “chunking”) the 
error changes to “Could not contact back-end site” (error text is from the 
Process Request method in ReverseProxy.cs).

By the way I also tried increasing the byte[] array in CopyStream but that did 
not help.

In all attempted versions of ReverseProxy.cs I get an error in 100 seconds.  I 
have changed the web.config in both Machine A (hosting ReverseProxy.cs) and 
Machine B (my web app) to include:

  <system.web>
    <httpRuntime maxRequestLength="2097151" executionTimeout="36000"/>

but still fails.

I can’t find any errors in the event logs on either machine related to 
timeout or otherwise.  I assume (maybe incorrectly) the problem has to be 
related to timeout but where/how can I fix it?  Any ideas?   Thanks.

Original issue reported on code.google.com by [email protected] on 4 Dec 2011 at 8:53

GoogleCodeExporter avatar Mar 26 '16 21:03 GoogleCodeExporter

MORE INFO:
After adding the "chunking" change from Issue 7 and the error message it looks 
like the file is actually uploaded ok!  The error could be suppressed but not 
desireable as it would be masking errors.

Original comment by [email protected] on 4 Dec 2011 at 10:45

GoogleCodeExporter avatar Mar 26 '16 21:03 GoogleCodeExporter

RESOLVED:
Added one line to the method ProcessRequest in ReverseProxy.cs
              .
              .
              .
       request.Method = context.Request.HttpMethod;
       request.ContentType = context.Request.ContentType;
       request.UserAgent = context.Request.UserAgent;
       request.Timeout = 3000000;  // <--- Added this line

Original comment by [email protected] on 8 Dec 2011 at 6:58

GoogleCodeExporter avatar Mar 26 '16 21:03 GoogleCodeExporter