Increase file upload size limit in iis6
Asked Answered
S

4

15

Is there any other place besides the metabase.xml file where the file upload size can be modified?

I am currently running a staging server with IIS6 and it is setup to allow uploading of files up to 20mb. This works perfectly fine. I have a new production server where I am trying to setup this same available size limit. So I edited the metabase.xml file and set it to 20971520. Then I restarted IIS and that didn't work. So I then restarted the entire server, that also didn't work. I can upload files around 2mb so it is definitely allowing file sizes larger then the standard 200kb default size. I try uploading a 5mb file and my upload.aspx page completely crashes. Is it possible there is something else I need to configure? The production server is located on a server farm, could there be some limits set on there end?

Thanks

Squall answered 20/12, 2008 at 21:47 Comment(0)
E
6

If you're using ASP .NET, then you need to modify the maxRequestLength web.config property.

See this link.

Elo answered 20/12, 2008 at 21:55 Comment(3)
Yep, the default max file size is 4MB: msdn.microsoft.com/en-us/library/…Riggall
In my staging server I don't have those set. Yet I am still able to upload larger files.Squall
The Maxrequestlength attribute seemed to work. For some reason I do not have that set in my staging server and it still works. Oh well, ThanksSquall
A
35

I will extend my answer to your question to take into account other possible situations.

A very good link to learn about uploading big size files is this one: http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx

Here Jon Galloway explains the best techniques to treat the problem:

1.-Changing machine config or web.config:

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

Here you change not only the maxRequestLength, but you must give more seconds for the executionTimeout.

Interesting thing: Take into account that the value of this setting is ignored in debug mode. The default in .NET Framework 2.0 is 110 seconds. In the .NET Framework 1.0 and 1.1, the default is 90 seconds.

2.-Talking about the real solution, HttpModules like the free of charge NeatUpload

3.-Explaining another way of uploading more intuitively: Silverlight or flash swfupload

4.-He speaks about one restriction II7 has. In this page http://www.telerik.com/help/aspnet-ajax/upload_uploadinglargefiles.html you can find more interesting settings for IIS 7, to set a maximum of 100 megas. You add:

 <system.webServer>
...
   <security >
     <requestFiltering>
       <requestLimits maxAllowedContentLength="1024000000" />
     </requestFiltering>
   </security>
</system.webServer> 

And you must open the file C:\Windows\System32\inetsrv\config\applicationHost.config and find the line:

<section name="requestFiltering" overrideModeDefault="Deny" />

changing to:

<section name="requestFiltering" overrideModeDefault="Allow" />

Another interesting thing Galloway mentions: "In ASP.NET 1.0 and 1.1, the entire file was loaded into memory before being written to disk. There were improvements in ASP.NET 2.0 to stream the file to disk during the upload process."

For IIS6 the solution Chris gives I think is appropriate:

http://www.banmanpro.com/support2/File_Upload_limits.asp

Another source:

http://www.telerik.com/support/kb/aspnet-ajax/upload/page-not-found-error-when-uploading-large-files-on-win2003.aspx


Another URL where one user has tested a lot of components here:

http://remy.supertext.ch/2008/01/file-upload-with-aspnet/

He refers to a codeproject project (!) that is another very good example of using large files and flash here:

http://www.codeproject.com/KB/aspnet/FlashUpload.aspx

Airbrush answered 20/12, 2008 at 22:39 Comment(0)
E
6

If you're using ASP .NET, then you need to modify the maxRequestLength web.config property.

See this link.

Elo answered 20/12, 2008 at 21:55 Comment(3)
Yep, the default max file size is 4MB: msdn.microsoft.com/en-us/library/…Riggall
In my staging server I don't have those set. Yet I am still able to upload larger files.Squall
The Maxrequestlength attribute seemed to work. For some reason I do not have that set in my staging server and it still works. Oh well, ThanksSquall
T
2

I have been struggling with this issue for hours now and finally have solved my particular problem and I want to share it here.

If you are using urlscan, there is a file size limit in its configuration as well. To make changes to that, you need to edit the file "UrlScan.ini" located (typically) at:

C:\WINDOWS\system32\inetsrv\urlscan

Change the value for "MaxAllowedContentLength" to your desired max file size value.

Tribunal answered 29/5, 2012 at 22:6 Comment(0)
C
0

If you are uploading document from rad-control than you can just use this line of code.

RadFileExplorer1.Configuration.MaxUploadFileSize = 2000 * 1024; 

It worked for me.

Chesterchesterfield answered 1/7, 2014 at 8:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.