How to query maxRequestLength?

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

I'd like to display the maxRequestLength value on a page, so users could see
what the aprox current file upload size limit is. Can the value of
maxRequestLength be determined at runtime? Can it be done if you don't
know, at runtime, if it's set in the machine config (default) or app web
config?

Thanks

Brad
 
Hi Brad,

Based on my research and experience, we cannot get the value of
masRequestLength directly at runtime. I have checked the following document.

Accessing ASP.NET Configuration Settings
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpgrfaccessingaspnetconfigurationsettings.asp
"...
You can access public configuration settings from within an ASP.NET
application..."

My suggestion is looking the web.config or machine.config file as a common
XML file. Then we can use the System.Xml.XmlDocument class to get what we
want.

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top