I have come across this error multiple times at work. This problem occurs because the default value for the maxRequestLength parameter in the section of the Machine.config or Web.Config file is 4096 (4 megabytes). As a result, files that are larger than this value are not uploaded by default.

To resolve this problem, use one of the following methods:

  • In the Machine.config file, change the maxRequestLength attribute of the <httpRuntime> configuration section to a larger value. This change affects the whole computer.
  • In the Web.config file, override the value of maxRequestLength for the application. For example, the following entry in Web.config allows files that are less than or equal to 1 GB to be uploaded:
                         <httpRuntime maxRequestLength="1048576" />

Max value for maxRequestLength attribute is "1048576" (1 GB) for .NET Framework 1.0 or 1.1 and "2097151" (2 GB) for .NET Framework 2.0.

Note: During the upload process of large files, built-in ASP.NET loads the whole file in memory before the user can save the file to the disk. Therefore, the process may recycle because of the memoryLimit attribute of the processModel tag in the Machine.config file. More info you can find in Microsoft KB article: http://support.microsoft.com/default.aspx?scid=kb;EN-US;295626

Signature

Comments

5/3/2007 9:21:42 AM #

Vaughan Chetwynd

Excellent article...... solved my upload problem immediately.
Thank you.

Vaughan Chetwynd New Zealand

5/10/2007 3:09:43 AM #

lol

lol

lol United Kingdom

5/30/2008 7:45:56 PM #

Shahaji Nangare (Senior System Analyst)

My problem is Maximum request length exceeded. It is solved immediately. Thanks.

Shahaji Nangare (Senior System Analyst) India

7/6/2008 8:39:24 PM #

Isaac Zothanpuia

Thanks a lot.....

Isaac Zothanpuia India

9/7/2008 11:33:00 PM #

Thiyagu

Really it's very helpfull articile

Thiyagu India

10/26/2008 11:30:09 PM #

thanks

Thank you!  This solved my problem immediately!

thanks United States

11/24/2008 1:42:58 AM #

Mark

I was getting this error when attempting to display and handle a large amount of data on the page. Simply changing the maxRequestLength did not fix the problem, but rather modifying the other attributes of httpRuntime in conjunction with maxRequestLength corrected the issue.

maxRequestLength="2097151"
executionTimeout="12000"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
/>

Reference: msdn.microsoft.com/en-us/library/e1f13641.aspx

Mark United States

3/11/2009 2:54:17 PM #

Arseny

Thanks. This article is still actual.

Arseny United Kingdom

7/13/2009 8:03:54 AM #

saravana perumal c

I am using IIS7. It gives error when I added "maxRequestLength" in the web.config file. Whehter this settings still exists?

saravana perumal c India

7/13/2009 2:34:20 PM #

Vishwa

Please make sure that you are adding it in correct section of web.config and IIS has correct .NET Framework selected for your app.

Vishwa United States

7/28/2009 5:03:48 AM #

Wilson

Thanks guys. This thread helps me to resolve the problem faced.

Wilson Malaysia

8/8/2009 11:35:11 PM #

Kjoplin

This fixed my 'Maximum Length Exceeded' type error as well. Thanks a bunch Smile

Kjoplin United States

8/12/2009 5:24:19 PM #

wibizone

Thats very helpfull. Thanks a lot

wibizone Indonesia

8/12/2009 6:30:56 PM #

San Diego Foreclosure

You made me late for work reading this. Nice blog, just bookmarked it for later reference.

San Diego Foreclosure United States

10/13/2009 12:38:55 AM #

Sue

Thank you for this article.  I really appreciate it.  I also appreciate the fact that you got straight to the point!  Thanks.

Sue United States

12/11/2009 11:30:04 PM #

Edward

Thank you. You saved my day.

Edward Hong Kong S.A.R.

2/8/2010 10:30:25 PM #

Prashanth M

Hello,

You saved my day with this resolution. It solved my issue instantly after modifying the web.config file.

Thanks a lot for this help.

Prashanth M India

4/6/2010 3:13:27 PM #

Antonio

Ottimo consiglio! Grazie!

Antonio Italy

5/12/2010 11:13:14 PM #

Georgianne Tsui

hi it is my first post on this web and firstly I would like to thank you for the great quality information, which I found in this and all previous posts , it really helped me a lot. I will definitely add this website on my rss reader ;) Also, I would like to ask - don't you mind if I will quate some information from your blog because I am writing articles for the Hub pages, Ezine and other articles directories (this is my part time job)? It would really help me with some of mine articles. Of course, I will mention your website title or URL (not all articles directories allows URL's , so I can't 100% promise that you will get a direct link to your blog).

Georgianne Tsui United States

7/15/2010 9:33:42 PM #

joel abulencia

tenkyu po jejeje

joel abulencia Philippines

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading



About Me

Me Hello,my name is Vishwa Mohan Kumar.
I am a Software Architect. This blog is result of my experiments.

Flickr Photos

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Recent Comments

Comment RSS

Live Traffic Feed