当前位置:网站首页>Solve the error caused by too large file when uploading file by asp.net
Solve the error caused by too large file when uploading file by asp.net
2022-07-25 15:03:00 【Kimizhou_ blog】
Even in web.config You can't add nodes and settings to , It's a big mistake ,
<httpModules>
<add name="UploadHttpModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload"/>
</httpModules>
<httpRuntime executionTimeout="6000000000" maxRequestLength="900000000" useFullyQualifiedRedirectUrl="true" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100" enableVersionHeader="true" maxQueryStringLength="10240" />
The solution requires the following three things to solve the problem :
1: stay web.config In file , Of configuration Add the following node to the first node under the node :
<configuration>
<!-- Solve the problem that the uploaded file is too big -->
<configSections>
<sectionGroup name="system.web">
<section name="neatUpload" type="Brettle.Web.NeatUpload.ConfigSectionHandler, Brettle.Web.NeatUpload" allowLocation="true" />
</sectionGroup>
</configSections>2: stay web.config Under the document system.web Add the following nodes under the node of
<system.web>
<neatUpload useHttpModule="false" maxNormalRequestLength="40960000" maxRequestLength="20971510000" defaultProvider="FilesystemUploadStorageProvider">
<providers>
<add name="FilesystemUploadStorageProvider" type="Brettle.Web.NeatUpload.FilesystemUploadStorageProvider, Brettle.Web.NeatUpload"/>
</providers>
</neatUpload>3: At this time, you will find that the local can upload successfully , But in IIS It's still not good , You need to IIS To set up IIS Upload size , The setting method is as follows :
modify IIS Of applicationhost.config
file location : %windir%/system32/inetsrv/config/applicationhost.config
find <requestFiltering> node , Be careful requestFiltering There is no node by default requestLimits Node , You need to add the following nodes , Of course , If the node already exists , Then just modify
Add the following elements to this node :
<requestLimits maxAllowedContentLength="2147483647" /> ( The size of the upload will be changed to 2G)
At this time, you will find that OK 了 .
Be careful : In addition to modification IIS The way of documentation , You can also modify the configuration file , I've experienced :
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxQueryString="10240" maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>边栏推荐
- sql to linq 之存储过程偏
- LeetCode_字符串_中等_151.颠倒字符串中的单词
- awk从入门到入土(24)提取指令网卡的ip
- How to use the random number function of JMeter
- [thread knowledge points] - spin lock
- Awk from getting started to digging in (21) awk script debugging
- LeetCode_ Factorization_ Simple_ 263. Ugly number
- 006操作符简介
- I hope some suggestions on SQL optimization can help you who are tortured by SQL like me
- [C题目]力扣88. 合并两个有序数组
猜你喜欢

Gonzalez Digital Image Processing Chapter 1 Introduction

Heyuan City launched fire safety themed milk tea to boost fire prevention and control in summer
![[MySQL series] - how much do you know about the index](/img/d7/5045a846580be106e2bf16d7b30581.png)
[MySQL series] - how much do you know about the index

微信公众号正式环境上线部署,第三方公众平台接入

Yarn: the file yarn.ps1 cannot be loaded because running scripts is prohibited on this system.

Client error: invalid param endpoint is blank

44 Sina navigation, Xiaomi sidebar exercise

Implement a simple restful API server

As methods for viewing and excluding dependencies

云安全技术发展综述
随机推荐
Jmeter的随机数函数怎么用
oracle_12505错误解决方法
Awk from getting started to digging in (21) awk script debugging
6线SPI传输模式探索
MySQL的登陆【数据库系统】
安装EntityFramework方法
@Scheduled source code analysis
BigDecimal rounds the data
QT connect, signal, slot and lambda comparison
Kibana operation es
How to use the random number function of JMeter
Leetcode combination sum + pruning
基于AMD EPYC服务器的EDA芯片设计解决方案
awk从入门到入土(21)awk脚本调试
[C题目]力扣876. 链表的中间结点
awk从入门到入土(20)awk解析命令行参数
[nuxt 3] (XI) transmission & module
[Nuxt 3] (十一) 传送 & 模块
awk从入门到入土(24)提取指令网卡的ip
[MySQL must know and know] trigger | permission management