In the mail sending system or some other website that transmits the file, the user transmits the file the size is limited, because this can not only save the server space, but also can improve the speed of transferring files. The following describes how to configure the limit upload file size and time in the Web. config file.
When you configure the limit upload file size and time string in the Web. config file, it is done in the
maxRequestLength property: Used to prevent server attacks, such as denial of access caused by a user sending large files to the server. Default value is 4096 (4MB)
Executiontimeout Property: Specifies the maximum number of seconds that a request is allowed to execute before an ASP. NET application shuts down automatically. This time-out property is only applicable if the Debug property in the compilation element is false. The default value is 110s.
Add the following code to the <system.web></system.web> within Web. config:
<!--
To support uploading large files, default support 4M, now modified to 400M
HttpRuntime is to configure the ASP. NET HTTP runtime settings to determine how to handle requests to an ASP.
Executiontimeout: Represents the maximum time limit allowed to execute a request, in seconds
maxRequestLength: Indicates the maximum file upload size supported by ASP. This restriction can be used to prevent denial of service attacks that result from the user passing a large number of files to the server. The specified size is in kilobytes. The default value is 4096 KB (4 MB).
useFullyQualifiedRedirectUrl: Indicates whether client redirection is fully qualified (in the "Http://server/path" format, which is required for some mobile controls), or indicates whether a relative redirect is sent to the client instead. If true, all redirects that are not fully qualified are automatically converted to the fully qualified format. False is the default option.
minFreeThreads: Specifies the minimum number of free threads that are allowed to execute new requests. An ASP. NET makes the specified number of threads free by requiring additional threads to complete their processing requests. The default value is 8.
minLocalRequestFreeThreads: Represents the minimum number of free threads that ASP. NET remains allowed to perform new local requests. The number of threads is reserved for incoming requests from the local host, in case some requests make child requests to the local host during their processing. This avoids possible deadlocks caused by recursive re-entry into the WEB server.
appRequestQueueLimit: Represents the maximum number of requests that ASP. NET will queue for the application. When there are not enough free threads to process the request, the request is queued. When the queue exceeds the limit specified in this setting, the incoming request is rejected through the "503-Server Too busy" error message.
Enableversionheader: Indicates whether the specified ASP. NET version header should be output. Microsoft Visual Studio 2005 uses this property to determine which version of ASP is currently in use. For a production environment, this property is not required and can be disabled.
-
Web. config file configuration limits upload file size and time