Default limit to file uploads via HTTP?

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
 
J

Juan T. Llibre

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.
 
D

darrel

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
 
J

Juan T. Llibre

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top