Recently did the project when the user proposed to upload a large picture a picture may be more than 10 trillion originally used by the third party upload control has limited picture upload size settings
Previously set is 2M in accordance with the requirements of users that directly limit the size of the picture upload settings can be changed, but when uploading large pictures is always abnormal:
error message : exceeds maximum request length
Solution :
Error reason: asp.net default maximum upload file size is 4M, run timeout is 90S.
modifying configuration in Web.config
<configuration>
<system.web>
Usefullyqualifiedredirecturl= "true" executiontimeout= "
</system.web>
<configuration>
|
after this change in my project, it's no problem to upload. Simple explanation :
Executiontimeout Execution timeout: unit is seconds
|
maxRequestLength Upload Maximum length: The above I set is already the largest number of units in KB
|
PS: Here is the httpruntime complete configuration and related explanations
Usefullyqualifiedredirecturl= "true" minfreethreads= "8"
Minlocalrequestfreethreads= "4" apprequestqueuelimit= "enableversionheader=" "true"/>
HttpRuntime is to configure the ASP.net HTTP run settings to determine how to handle requests for asp.net applications.
Executiontimeout: Represents the maximum time limit, in seconds, that a request is allowed to execute
maxRequestLength: Indicates the maximum file upload size supported by asp.net. This display can be used to prevent denial of service attacks caused by a user passing a large number of files to the server. The specified size is in kilobytes. The default value is 4096KB.
Userfullyqualifiedredirecturl: Indicates whether client redirection is fully qualified (in the form of "Http://server/path", which is necessary for some mobile controls), or whether relative redirection is sent to the client instead. If true, all redirects that are not fully qualified are automatically converted to fully qualified formats. False is the default option.
minFreeThreads: Specifies the minimum number of free threads that are allowed to execute new requests. Asp. NET maintains a free state for a specified number of threads that require additional threads to complete their processing requests. The default value is 8.
minLocalRequestFreeThreads: Represents the minimum number of free threads that the ASP.net maintains to allow the execution of new local requests. The number of threads is reserved for incoming requests from the local host in case some requests issue a child request to the local host during its processing. This avoids deadlocks that may be caused by recursion to re-enter the Web server.
Enableversionheader: Indicates whether the specified asp.net should output a version of the header. VS2005 uses this property to determine the current use of the ASP.net version. For a production environment, this property is not required and can be disabled.