Solution
1. Modify IIS applicationhost. config
A. File Location: % WINDIR %/system32/inetsrv/config/applicationhost. config
B. Find the <requestfiltering> node.
C. Add the following elements to the node: <requestlimits maxallowedcontentlength = "2147483647"/> (the upload size will be changed to 2 GB)
Note: by default, no <requestlimits maxallowedcontentlength = "upload size value (unit: byte)"/> element exists for this node.
2. Add the following content to Web. config:
<Configuration>
<System. Web>
<Httpruntime maxrequestlength = "2097151" executiontimeout = "120"/>
</System. Web>
</Configuration>
CopyCodeNote:
Httpruntime: Configure ASP. net http runtime settings to determine how to handle ASP. NET ApplicationsProgram.
Maxrequestlength (indicating the maximum file upload size supported by ASP. NET)
Specify the input stream buffer threshold (in KB ). This restriction can be used to prevent denial-of-service attacks. For example, a denial-of-service attack caused by a large file being sent to the server.
The default value is 4096 (4 MB), and the maximum value is only 2097151 kb.
Executiontimeout: specifies the maximum number of seconds allowed to execute a request before it is automatically disabled by ASP. NET. The default value is 90 seconds.
This timeout attribute applies only when the debugging attribute in the compilation element is false. To help avoid shutting down the application during debugging, do not set this timeout attribute to greater than timeout.
3. In web. config, add the following content to the <system. webserver> node.
<Security>
<Requestfiltering>
<Requestlimits maxallowedcontentlength = "2147483647"> </requestlimits>
</Requestfiltering>
</Security>
In the preceding example, maxallowedcontentlengt is in BK.