ASP.NET Cafe
new tricks every week

ASP.NET 2.0 Big files upload on IIS 6.0 under Win2003

Saturday, 2 August 2008 06:21 by dmitriy

Recently faced the big problem with big files. Not so big, just needed to post files with size about 10-20MB to aspx page. With usage of quite standard control on the page.

Everybody know ( if not - I notice here ) that in web.config you have HttpRuntime settings. And one of these settings is  maxRequestLength .In theor, after adding of this line to web.config file everything should work fine.

 <httpRuntime maxRequestLength="100000"/>

But in fact you can face the problem of limit in IIS. And this is a pain in the ass. Because you need to edit Metabase.xml on server. Sometimes this can be impossible, but sometimes you can do this yourself or ask support. Here is some insturctions to make big files uploads work for you.

 

IIS 6 has a limit on the maximum number of bytes that can becontained in an ASP request.  By default, that limit is 4 MB. To change this:

  1. Open IIS (Start->Programs->Administrative Tools-Internet Information Services)
  2. Right-Click the server name and select Properties
  3. Check the Enable Direct Metabase Edit box and hit Apply
  4. Next browse to and open the Metabase.xml file. It is typically located in c:\Windows\System32\inetsrv directory.  You can use Notepad to modify this file.
  5. Search for "ASPMaxRequestEntityAllowed" and change its value to "1073741824"
  6. Save changes in Notepad and exit.
Later you can set your own limits in web.config. For example, using <location> tag you can apply maxRequestLength only for specific pages.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:  
Categories:   ASP.NET
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed

Comments

Add comment


 

  Country flag

biuquote
  • Comment
  • Preview
Loading