<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="EasyAlgo.EAUpload"> <section name="Environment" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <section name="ErrorsProcessing" type="System.Configuration.SingleTagSectionHandler, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </sectionGroup> ... </configSections> <EasyAlgo.EAUpload> <Environment TemporaryPath="C:\Temp" ChunkSize="65536" ProcessPages="*.aspx" UploadIDParameter="UploadId" MaxRequestLength="1048576" ExecutionTimeout="3600" EnableProgressInfo="true" SerialKey="Please enter a valid serial key!" /> <ErrorsProcessing ThrowErrorsImmediately="true" /> </EasyAlgo.EAUpload> ... <system.web> ... <httpModules> <add name="EAUploadModule" type="EasyAlgo.EAUpload.EAUploadModule, EasyAlgo.EAUpload" /> </httpModules> ... <sessionState timeout="60" /> ... </system.web> </configuration>
EasyAlgo.EAUpload section:
See description of EAUpload settings schema EAUpload Configuration.
EasyAlgo.EAUpload section is optional, and you can use the short configuration versoin.
If you had chosen the short configuration versoin then you should register the EAUpload component as shown below:
// Global.asax.cs public class Global : System.Web.HttpApplication { ... public override void Init() { License.SerialKey = "valid serial key"; base.Init(); } ... }
' Global.asax.vb Public Class Global Inherits System.Web.HttpApplication ... Public Overrides Sub Init() License.SerialKey = "valid serial key" MyBase.Init End Sub ... End Class
httpModules section
EAUploadModule intercepts and processes POST requests, with "multipart/form-data" content type, to any or specified resources in ASP.NET application. For correct work of EAUpload component you should attach EAUploadModule to the ASP.NET request pipeline.
To integrate the EAUploadModule into your ASP.NET application you need to add it using a line in the httpModules subsection of the web.config file. This is shown in the example web.config file above.
In IIS 7.0, an application can run in either Classic or Integrated mode. In Classic mode, requests are processed basically the same as they are in IIS 6.0. In Integrated mode, IIS 7.0 manages requests by using a pipeline that enables it to share requests, modules, and other features with ASP.NET.
The procedure for registering a EAUploadModule is different in IIS 7.0 Classic mode and IIS 7.0 Integrated mode. To register the module for IIS 7.0 running in Integrated mode add the following highlighted code to the Web.config file:
<configuration> ... <system.webServer> <modules> <add name="EAUploadModule" type="EasyAlgo.EAUpload.EAUploadModule"/> </modules> </system.webServer> ... </configuration>
You can use also the following compact configuration.
<?xml version="1.0" encoding="utf-8" ?> <configuration> ... <system.web> ... <httpRuntime maxRequestLength="1048576" executionTimeout="3600" /> <httpModules> <add name="EAUploadModule" type="EasyAlgo.EAUpload.EAUploadModule, EasyAlgo.EAUpload" /> </httpModules> <sessionState timeout="60" /> ... </system.web> </configuration>
httpRuntime section:
- maxRequestLength - This attribute is used to limit the size of uploads by rejecting any which exceed a certain limit. The limit refers to the total size of the HTTP upload in KB (approximately equal to the sum of all the files being upload). In the example above the maxRequestLength is set to 1 GB.
MaxRequestLength parameter of EasyAlgo.EAUpload configuration is a replacement of maxRequestLength attribute.
- executionTimeout - The execution time-out refers to the number of seconds an ASP.NET page is given before the operation is assumed to have failed and the page terminated. If you are uploading a large file the code that is receiving the transfer may time out before the file has been completely uploaded. In the example above the executionTimeout is set to one hour.
ExecutionTimeout parameter of EasyAlgo.EAUpload configuration is a replacement of executionTimeout attribute.
sessionState section
- timeout - The session time-out refers to the number of minutes before the user session is aborted. If a large file is being uploaded it is desirable to maintain the session state. The session time-out should always be longer than the amount of time you expect uploads to take. Note that this value is only relevant if you have session state enabled. In the example above the sessionState is set to one hour.
