Default limit to file uploads via HTTP?

  • Thread starter Thread starter darrel
  • Start date Start date
D

darrel

I've built a file upload component for our CMS so people can upload images,
PDFs, etc.

I just ran into a snag with an 8mb PDF file. If I try to upload this, I
immediate get a 'application has timed out error, try again?'. Any other
file goes fine, but not this huge PDF file.

Is there a default file size limit uploading files via HTTP that I need to
explicitely change in my application?

-Darrel
 
Make sure that your web.config's httpruntime configuration section
has a sufficiently large value for maxRequestLength, measured in KB :

This example sets the maximum file size allowed to exactly 8MB :

<httpRuntime
executionTimeout = "110"
maxRequestLength = "8192"
/>

Increment it if you need a larger upload size.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
This example sets the maximum file size allowed to exactly 8MB :

<httpRuntime
executionTimeout = "110"
maxRequestLength = "8192"
/>

Ah! Perfect. Is there a way to accurately figure out the executionTimeout or
is that dependant on too many other variables?

-Darrel
 
Yes, that depends on a lot of other variables.

The executionTimeout is measured in seconds or, optionally, as a TimeSpan.
"00:01:50" is the same "110" default value for ASP.NET 2.0. For 1.1, it's 90 seconds.

It's there only to insure that there's no deadlocked requests.

Do not set this time-out to a large value.
Test, by trial and error for an optimum setting. The default should be OK.

This timeout applies only if the debug attribute in the compilation element is set to False.




Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
 
Back
Top