Remove the size limit for ASP. NET files to be uploaded

Source: Internet
Author: User

Remove the size limit of ASP. NET uploaded files

Today I made an upload function, using the FileUPLoad of vs2005. After trying to upload several times, I found this problem. If the number of uploaded files is less than 4 MB, everything is normal, however, if it exceeds the limit, a page with about: blank appears, and the problem is found later. It turns out to be like this: ASP. NET by default, ASP.. NET file size limit is 4 MB.

The solution is also simple: add

 
 
  1. <configuration> 
  2. <system.web> 
  3. <httpRuntimemaxRequestLengthhttpRuntimemaxRequestLength="1048576"
    executionTimeout="3600"/> 
  4. system.web> 
  5. configuration> 

That's all. MaxRequestLength: indicates the maximum number of bytes uploaded by ASP. NET over HTTP. 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 ). ExecutionTimeout: indicates the maximum number of seconds allowed to execute a request before it is automatically disabled by ASP. NET. When the file size exceeds the specified size, if a DNS error occurs in the browser or the service is unavailable, modify the above configuration to increase the number of configurations.

In addition, this problem may occur when ASP. NET uploads files: aspnet_wp.exe (PID: 1520) is recycled because the memory consumption exceeds 60 of 460 MB of available RAM ). If this error message is returned, the memoryLimit attribute value is added to WebConfig. For example:

 
 
  1. <configuration> 
  2. <system.web> 
  3. <processModelmemoryLimitprocessModelmemoryLimit="80"/> 
  4. system.web> 
  5. configuration> 

The above is to lift the size limit of ASP. NET files to increase the memory usage to 80%.

  1. Use Web Parts in ASP. NET 2.0
  2. JavaScript and ASP. NET controls Integration
  3. ASP. NET authentication and authorization
  4. Introduction to ASP. NET 2.0 Virtual Hosts
  5. Asp. Net dynamic page Conversion

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.