When does the httpRuntime maxRequestLength setting kick in?

G

Guest

Hi all

I'm developing a site where visitors can upload images (using the html file
input control). As most webhosting companies set a monthly bandwidth limit I
want to try and limit the size of uploads.

I thought about using the <httpRuntime> "maxRequestLength" setting, which
throws an exception if a HTTP request is too large. Does anyone know if this
will work, or will it occur too late in the request lifecycle. I.E. will the
webhost's bandwidth monitor "capture" the request before ASP.Net (or IIS?)
rejects the request length?


Many thanks
Andy
 
B

bruce barker \(sqlwork.com\)

maxRequestLength is used to monitor the input stream (upload). if the max
length is hit, then asp.net closes the request stream giving the browser an
error. so if you max was set a 2mb, and the user tried to upload a 4mb file,
they would get an error in the middle of their upload, and your webhost
would charge you for 2mb of bandwidth.

-- bruce (sqlwork.com)
 

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

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top