当前位置:网站首页>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>边栏推荐
- IP地址分类,判断一个网段是子网超网
- 51 single chip microcomputer learning notes (2)
- Several methods of spark parameter configuration
- 转载----如何阅读代码?
- 基于AMD EPYC服务器的EDA芯片设计解决方案
- "Ask every day" what is volatile
- Leetcode combination sum + pruning
- 6线SPI传输模式探索
- 37 element mode (inline element, block element, inline block element)
- Automatically set the template for VS2010 and add header comments
猜你喜欢

51 single chip microcomputer learning notes (1)

Live classroom system 05 background management system

Go language founder leaves Google

Wechat official account official environment online deployment, third-party public platform access

Unable to start web server when Nacos starts

006操作符简介
![[MySQL must know and know] trigger | permission management](/img/59/cb805d972097a6a8ed7f3ae454a91d.png)
[MySQL must know and know] trigger | permission management

41 picture background synthesis - colorful navigation map
![[Nacos] what does nacosclient do during service registration](/img/76/3c2e8f9ba19e36d9581f34fda65923.png)
[Nacos] what does nacosclient do during service registration

【MySQL系列】-索引知多少
随机推荐
Visual Studio 2022 查看类关系图
Client error: invalid param endpoint is blank
44 新浪导航 ,小米边栏 练习
云安全技术发展综述
06、类神经网络
Gson and fastjson
"How to use" observer mode
About RDBMS and non RDBMS [database system]
bridge-nf-call-ip6tables is an unknown key异常处理
pkg_resources动态加载插件
"Ask every day" reentrantlock locks and unlocks
Awk from entry to earth (24) extract the IP of the instruction network card
[MySQL series] - how much do you know about the index
Number of high-quality number pairs [bit operation characteristics + abstract ability evaluation + grouping fast statistics]
SSM Advanced Integration
easygui使用的语法总结
Unable to start web server when Nacos starts
Wechat official account official environment online deployment, third-party public platform access
32 chrome调试工具的使用
MySQL的登陆【数据库系统】