Easy Projects can handle large file uploads, but because of default settings to .net and IIS, this process may timeout before the upload is complete, resulting in a file not being uploaded.
Below are some modifications you can make to your web.config file, machine.config file, and IIS metabase to allow large file uploads, if you are experiencing time out errors:
You can upload files with a combined size of up to 2GB, but it
requires some modifications in your application configuration files.
||The configuration file sections and attributes are case sensitive. This means that the sections and
attributes below will be incorrect if written using a case other than shown.
The following attributes can be assigned to the <httpRuntime> tag in the <system.web> section of the Web.config
Specifies the limit for the input stream buffering threshold, in KB. This limit can be used to prevent denial of service attacks that are caused, for example,
by users posting large files to the server. The default value is 4096 (4 MB).
To enable large file uploads you need to change the value of this
attribute to the largest allowed combined file size for your
application. If someone selects and uploads files
with total size larger than maxRequestLength, this will result in a "Page not found" error (which is the default error of the Framework).
RadUpload does not provide a way for handling this error.
||The MaxFileSize property of the RadUpload control specifies the maximum size for each of
the uploaded files in bytes.
Specifies the maximum number of seconds that a request is allowed to
execute before being automatically shut down by ASP.NET. 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
To enable large file uploads, which can take large periods of time, increase the value of this property.
How to modify web.config
To make the above modifications to your application for large file uploads you need to:
- Open the Solution Explorer, navigate to the application web.config file and open it.
- Under the <configuration> element locate the <system.web> element. Add it if it does not exist.
- Under the <system.web> element locate the <httpRuntime> element. Add it if it does not exist.
- In the <httpRuntime> element locate the maxRequestLength and executionTimeout attributes. If they do not exist,
add them and set their values:
|[Web.config] httpRuntime attributes
<httpRuntime maxRequestLength="102400" executionTimeout="3600" />
The configuration, allowing uploads of files up to 100MB and upload periods up to 1 hour, should look like the following:
|[Web.config] Web.config settings for 100MB and 1 hour
<httpRuntime maxRequestLength="102400" executionTimeout= "3600"
The following attributes can be assigned in the <processModel> element of the machine.config file. They must be set at the machine
level, not the application level in web.config.
||These properties affect any response deadlock in ASP.NET, not just the application that uploads large files, and
should be used with caution.
Specifies the time interval, in the format HH:MM:SS, after which the process is restarted if the following conditions are met:
- There are queued requests.
- There has not
been a response during this interval. The default is 3 minutes. To
allow very large uploads, you may have to increase this value.
Specifies the time, in the format HH:MM:SS, that must elapse after
the last restart to cure a deadlock before the process is restarted to
cure a deadlock again. This prevents
thrashing on processes that require a relatively long startup time. The
default is 9 minutes. To allow very large uploads, you may have to
increase this value.
Sometimes when the application is hosted on Windows Server 2003, the above settings do not seem to have effect. In this case you must modify the IIS metadata
file, particularly the AspMaxRequestEntityAllowed property. You can find more information about that in the following KB article:
If you are using Microsoft URLScan you will need to modify its urlscan.ini and set
MaxAllowedContentLength to an appropriate value.
Third party network monitoring software
If you are using any third party network monitoring software you
should ensure that it is properly configured to allow file uploads with
the needed length and content. For more
information please, contact your network administrator.