Click here to Skip to main content
15,884,739 members
Articles / Web Development / ASP.NET
Tip/Trick

Setting maximum file uploading size

Rate me:
Please Sign up or sign in to vote.
1.00/5 (3 votes)
21 Feb 2010CPOL 11.7K   1
We can set the maximum file upload size for the web application application. For that, we need to set following properties in the httpRuntime section, which is under , which will be under section. maxRequestLength - This attribute is used to set is the maximum file upload size. We have to...
We can set the maximum file upload size for the web application application. For that, we need to set following properties in the httpRuntime section, which is under <system.web>, which will be under <configuration> section.

maxRequestLength - This attribute is used to set is the maximum file upload size. We have to specify this size in kilobytes(default is 4096 KB i.e. 4 MB). We can set this to use it according to our requirements, we can increase for uploading large sized files or decrease it to restrict user to limited length.

ExecutionTimeout - This attribute is used to set maximum number of seconds that a request is allowed to execute before automatically shut down


<configuration>
<system.web>
<httpRuntime maxRequestLength="20480" executionTimeout="1500"/>
</system.web>
</configuration>

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Junior) Excel Informatics, Pune
India India
Am Indrajeet T. Sutar. I am a web developer. I am working on .net technology. I have completed my Masters in Computers and Management (people call it as MCA, MBA etc.) Apart from programming i do photography (not regularly though), traveling and reading books.

Comments and Discussions

 
GeneralReason for my vote of 1 :( Pin
Arterius30-Oct-11 22:00
Arterius30-Oct-11 22:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.