solve asp.net The upload file exceeds the maximum request length

Time:2020-10-20

Error message: maximum request length exceeded

Error reason: asp.net By default, the maximum upload file size is 4m, and the running timeout is 90s.

Solution

1. Modification web.config The file can change this default value


<configuration>  
  <system.web>  
     <httpRuntime maxRequestLength="1048576" executionTimeout="3600" />
  </system.web>  
 <configuration> 

2. Another method is to modify. Net framework:

(1) Modify C / windows/ Microsoft.NET/Framework/v1 . 1.4322/config machine.config Documents.

(2) Look for “< httpruntime”. In this line, change the value of maxrequest length to an ideal value. For example, if you want 8m, enter 8192

In this way, any of your web projects can upload up to 8m files.

3. By the way, the modification method to limit the size of uploaded files in IIS is as follows:

(1) First, turn off the IIS service in the process inetinfo.exe The process is down.

(2) Find: Windows / system32 / inesrv in the system directory/ metabase.xml ”File, find a text editor to open it, and find aspmaxrequestentityallowed = 204800. This is the default size of the file uploaded by IIS. The default size is 204800byte, that is, 200KB. Change it to the required size.

This is the solution asp.net The problem that the uploaded file exceeds the maximum request length is the whole content shared by Xiaobian. I hope to give you a reference, and I hope you can support developeppaer more.

Recommended Today

Summary of computer foundation for 2021 autumn recruitment interview database, redis

Series of articles: Summary of computer foundation in autumn 2021 interview algorithm, data structure, design pattern, Linux Summary of computer foundation in autumn 2021 interview – Java foundation, JVM, spring framework Summary of computer foundation for 2021 autumn recruitment interview database, redis Summary of computer foundation for 2021 autumn recruitment interview – operating system Summary […]