Gets or sets the maximum request size.
Namespace:
EasyAlgo.EAUploadAssembly: EasyAlgo.EAUpload (in EasyAlgo.EAUpload.dll)
Version: 1.3.1.0
Syntax
| C# |
|---|
public int MaxRequestLength { get; set; } |
| Visual Basic (Declaration) |
|---|
Public Property MaxRequestLength As Integer |
Field Value
Type: System..::.Int64The Int32 value that specifies maximum request size in kilobytes.
Posible values:
- Default value is 4096
- Any value within the range from the 1 kilobyte to the 4194304 kilobytes (4 GB).
Remarks
This property is a reflection of EAUpload configuration parameter (<EasyAlgo.EAUpload>/<Environment ... MaxRequestLength="" ... >) and it is a replacment of httRuntime/maxRequestLength parameter of the httpRuntime configuration.
The MaxRequestLength property can be used to prevent denial of service attacks caused by users posting large files to the server. By using this property you can create a flexible policy for request processing.
The logic of EAUpload component defines:
Note:If you want to change this property at the runtime, you should define it at the Initializing stage of an upload (see EasyAlgo.EAUpload..::.UploadState for more information). All changes for processed uploads will be ignored.
Also if you have changed this property for the whole of EAUpload component (EAUploadModule..::.CommonEnvironment property) then new value will be used for the new uploads only.
The MaxRequestLength property can be used to prevent denial of service attacks caused by users posting large files to the server. By using this property you can create a flexible policy for request processing.
The logic of EAUpload component defines:
- If MaxRequestLength property value is specified by your code or by MaxRequestLength configuration parameter, then EAUpload component parses requests, which size doesn't exceed this value. "maxRequestLength" parameter of httpRuntime configuration is ignored.
- Otherwise MaxRequestLength property contains a value that is specified in "maxRequestLength" parameter of system.web/httpRuntime section in the web.config file.
- If previous conditions are not valid then EAUpload component uses default value that is defined for ASP.NET HTTP run-time. By default this value is 4096 kilobytes (4 MB).
Examples
You can find an example in the description of UploadEnvironment class.
Exceptions
| Exception | Condition |
|---|---|
| EasyAlgo.EAUpload..::.EAUploadConfigException | Thrown when the specified value is less than 1 kilobytes and greater than 4194304 kilobytes (4 GB). |
