The web page cannot be displayed when uploading large files in ASP. NET.

Source: Internet
Author: User

Recently, when I was working on the enterprise knowledge base, I found that the webpage could not be displayed when uploading files. After continuous debugging, I found that the default size for uploading files is 4 MB, when the value is less than 4 MB, the system runs normally. When the value is greater than 4 MB, the webpage cannot be displayed. The solution is as follows:
Add the following content to <system. Web> </system. Web> in Web. config:Code:

<! --
Used to support uploading large files. The default size is 4 MB, and the current size is 400 mb.

Httpruntime is used to configure Asp.net HTTP runtime settings to determine how to handle Asp.net applications. Program .

Executiontimeout: maximum time limit allowed for request execution, in seconds

Maxrequestlength: indicates the maximum file upload size supported by ASP. NET. This restriction can be used to prevent DoS attacks caused by a large number of files being transferred to the server. The specified size is in KB. The default value is 4096 KB (4 MB ).

Usefullyqualifiedredirecturl: indicates whether the client redirection is fully qualified (in the "http: // server/path" format, which is required by some mobile controls ), or indicates whether to send relative redirection to the client. If it is true, all non-fully-qualified redirects are automatically converted to a fully-qualified format. False is the default option.

Minfreethreads: specifies the minimum number of free threads allowed to execute new requests. ASP. NET allows a specified number of threads to remain free by appending threads to complete the requests it processes. The default value is 8.

Minlocalrequestfreethreads: the minimum number of free threads allowed to execute new local requests maintained by ASP. NET. The number of threads is reserved for requests passed in from the local host to prevent some requests from sending subrequests to the local host during processing. This avoids possible deadlocks caused by recursive re-entering the web server.

Apprequestqueuelimit: indicates the maximum number of requests that ASP. NET will queue for the application. Requests are queued when there are not enough free threads to process requests. When the queue exceeds the limit specified in this setting, the incoming request is rejected through the "503-the server is too busy" error message.

Enableversionheader: Specifies whether ASP. NET should output the version header. Microsoft Visual Studio 2005 uses this attribute to determine the current ASP. NET version. This attribute is not required for the production environment and can be disabled.
-->
< Httpruntime Executiontimeout = "500" Maxrequestlength = "409600" Usefullyqualifiedredirecturl = "False" Minfreethreads = "8" Minlocalrequestfreethreads = "4" Apprequestqueuelimit = "100"   />
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.