473,387 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to retrieve the value of maxRequestLength in the web.config ?

Example:
<configuration>
<system.web>
<httpRuntime maxRequestLength="2048" />
</system.web>
</configuration>

I need to kno in my code the value of key maxRequestLength.
Thanks in advance.
Nov 18 '05 #1
1 2808
Some web.config variables accessible through the framework, like
System.Web.SessionState.SessionStateMode, others, such as the
maxRequestLength are not (as far as I know). Therefore, the only solution
you'll have is to parse the web.config and jump to the value with an
xpath....the good news is since the worker process would restart itself
whenever that file changes, you can do it once in Application_Start and
store the value from that point on...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
<to**@titi.com> wrote in message
news:q5********************************@4ax.com...
Example:
<configuration>
<system.web>
<httpRuntime maxRequestLength="2048" />
</system.web>
</configuration>

I need to kno in my code the value of key maxRequestLength.
Thanks in advance.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James Geurts | last post by:
Hi, I am not able to find information on this elsewhere... Is there a way to get the HttpContext attribute maxRequestLength's value programmatically? I know I could load the web.config file as a...
2
by: Peter Row | last post by:
Hi, To allow users to upload files larger than 4MB in size I added: <httpRuntime maxRequestLength="102400" executionTimeout="600" /> ...to my web.config file. Fair enough this works fine....
25
by: moondaddy | last post by:
I have an application where users need to upload images and in my web.config file I have a setting like this: <httpRuntime maxRequestLength="512" /> Which restricts image larger than 500k from...
2
by: Jay | last post by:
I have been trying to use maxRequestLength to stop users from uploading large files. It put this code in the web.config file: <httpRuntime maxRequestLength="128" /> --The upload works...
3
by: Stephen Ahn | last post by:
Given a web service method defined like this : public string EchoByteArray(byte data) { return data.Length.ToString() + " bytes received"; } If, from a Windows C# app, I call this web...
1
by: Joseph Geretz | last post by:
I've been using the following (client-side) configuration block to allow WSE/DIME transfer of files larger than 4 meg: <messaging> <maxRequestLength>-1</maxRequestLength> </messaging> (Of...
1
by: Joseph Geretz | last post by:
I've been using the following (client-side) configuration block to allow WSE/DIME transfer of files larger than 4 meg: <messaging> <maxRequestLength>-1</maxRequestLength> </messaging> (Of...
2
by: Joseph Geretz | last post by:
I'm developing a Web Service using DIME to download and upload files from and to an IIS server. In order to increase the download filesize to unlimited, I have the following block in my App.config...
1
by: bixbarton | last post by:
Does anyone know how to obtain the MaxRequestLength easily? I have found that if you do the following; object getCon = HttpContext.GetAppConfig("system.web/httpRuntime") Then look at getCon...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.