Solved

Uploading large files in asp.net 2.0

Posted on 2010-11-18
10
504 Views
Last Modified: 2012-05-10
I have this in my web.config (iis7):

...
      <system.webServer>

    <security>
      <requestFiltering >
        <requestLimits maxAllowedContentLength="1024000000"  />
      </requestFiltering>
    </security>

...


However, I am still getting the Maximum request length exceeded. error no matter what I do if I try to upload over a 4mb file.

Is there something else I could try to get large uploads to work?
0
Comment
Question by:MikeCausi
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 28

Expert Comment

by:strickdd
ID: 34168113
There is a limitation in IIS as well (http://www.banmanpro.com/support2/File_Upload_limits.asp). You should also check the machine.config and increase it there.
0
 

Author Comment

by:MikeCausi
ID: 34168156
Is it not possible to set it at a web application level rather than the machine level?  

Also that link seems to be for IIS6.  I am using IIS7.
0
 
LVL 28

Expert Comment

by:strickdd
ID: 34168211
Same concept for IIS 7, they both have separate limitations: http://msdn.microsoft.com/en-us/library/bb968802%28VS.85%29.aspx. You can do it at the application level, but if adjusting the IIS 7 limit doesn't work, I would try the machine config just to be sure.
0
 

Author Comment

by:MikeCausi
ID: 34168329
My applicationhost.config file does not have a maxAllowedContentLength, which is says to remove in the file according the KB.

Where do I look for/add in my machine.config file for this?  Win 7 64bit.

I dont' get why it looks like the default is 30mb and I cannot even upload a 5 mb file.
0
 
LVL 18

Expert Comment

by:ChetOS82
ID: 34168472
You need to set the maxRequestLength in httpRuntime in the web.config file.  You don't need to change anything in the machine.config.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:vivekpv10
ID: 34170464
How much is the maximum size that u currently able to upload??
0
 

Author Comment

by:MikeCausi
ID: 34172842
No matter what I do, I'm still stuck at the 4MB limit!

I don't understand why the change to my web.config won't take effect.  I've even restarted IIS.  This is all on my localhost.
0
 

Author Comment

by:MikeCausi
ID: 34175716
I find it weird that II7 is supposed to allow 28.6mb, but we are still stuck at the iis 6 settings of 4mb?  Is something going on on my Windows 7 machine that is causing it to retain IIS6 settings?

“IIS6 uses the maxRequestLength config setting under the system.web section to specify maximum file upload size with a default of 4 MB.  IIS7 uses the maxAllowedContentLength config setting under the system.webServer section to specify maximum file upload size with a default of 28.6 MB. “

http://weblogs.asp.net/jeffwids/archive/2009/09/24/from-iis6-maxrequestlength-to-iis7-maxallowedcontentlengthfile-specifying-maximum-file-upload-size.aspx

0
 
LVL 18

Accepted Solution

by:
ChetOS82 earned 500 total points
ID: 34175867
Even in IIS7 you need to set <system.web><httpRuntime maxRequestLength, and it needs to be specified in KB.
0
 

Author Comment

by:MikeCausi
ID: 34175881
Interesting.  So, for IIS 7 we need both the setting in system.web and the system.webserver.  I will give that a try.  
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ASP.net pdf file opening in debug mode but not on web 13 32
JavaScript error 1 52
Jquey and footrable 2 34
Name space syntax error 12 39
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now