This article is a mirror article of machine translation, please click here to jump to the original article.

View: 40339|Reply: 3

[ASP.NET] asp.net 404 error when uploading large files in mvc

[Copy link]
Posted on 6/27/2016 7:27:44 PM | | | |



Let's talk about the file size first, the file is more than 900MB, just upload a test file.
The upload plug-in uses Baidu's webuploader, when the Baidu upload progress is full, and then, when you see the requested interface, it will report a 404 error.

Why is the 404 error?? Then, after debugging, I found that when uploading a 900m file, the progress bar was full, and there was no way to enter the interface.



Check the httpRuntime of web.config:

system.web:



This value is enough!!! What should I do???

Error message:

Most likely causes:
Request filtering on the web server is configured to deny the request because the content length exceeds the configured value.


What to try:
Confirm the configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength setting in the applicationhost.config or web.config file.

Links and more information
  This is a security feature. Please do not change this feature unless you are fully aware of the scope of the change. You can configure the IIS 7.0 server to reject requests whose content length is greater than the specified value. This error is returned if the length of the requested content is greater than the configured length. If you need to increase the content length, modify the configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength setting.


solution

It turns out that the upload file size of IIS7, even in classic mode, must be set in system.webServer, and it is OK to add it:




Finally, send a screenshot of uploading a large file!!!








Previous:html file upload box input tag
Next:base and this keywords in C#
 Landlord| Posted on 11/7/2016 1:16:38 PM |
 Landlord| Posted on 2/8/2017 11:17:40 AM |
Add the following code in the <system.web></system.web> in web.config:
<httpRuntime executionTimeout="600" maxRequestLength="512000" />     
maxRequestLength indicates the maximum uploaded file size, which is 51200 or 500MB
executionTimeout means timeout, 600 means 10 minutes (it is recommended to set a large point, otherwise 10 minutes will also time out if the network is bad)
 Landlord| Posted on 4/7/2021 10:31:34 AM |
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com