惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Vercel News
Vercel News
C
Check Point Blog
G
Google Developers Blog
博客园 - 司徒正美
量子位
Engineering at Meta
Engineering at Meta
S
SegmentFault 最新的问题
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
A
About on SuperTechFans
美团技术团队
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
Jina AI
Jina AI
Y
Y Combinator Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Cloudflare Blog
U
Unit 42

博客园 - rmhy

SQL Server中 特殊符号查询处理 MAS 激活命令 SSMS18 登陆界面清除不需要的登录账户 yum更换阿里源 MSSQL 维护小记(清理进程、重建索引) docker 部署 xxl-job 详细步骤 globalthis is not defined 钉钉H5应用报错(手机端) docker onlyoffice robocopy局域网拷贝 oracle 维护小记 oracle 导出空表 djange 2.0 连接 mssql 2008 sql 2008数据库日志清理(转) JS判断文本框是否数字包括小数 sql joins 网站无法播放flv格式 eml文件打开方式 更改域安全策略-密码必须符合复杂性要求 span 换行
IIS10设置上传大小限制的方法实现
rmhy · 2026-04-15 · via 博客园 - rmhy

 .net 报错如下: System.Web.HttpException: 超过了最大请求长度。解决方案:

IIS10 中找到所需要修改的站点,需要修改两个地方,最终webconfig如下:

可以从wobconfig修改,也可以从iis站点下的配置编辑器修改。

<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.5.2" />
 <!--最大请求长度,单位为KB(千字节),默认为4M,设置为1G,上限为2G -->
      <httpRuntime maxRequestLength="40960" targetFramework="4.5.2" />
    </system.web>
  <appSettings>
    <add key="FileType" value=".doc,.xls,.txt,.rar" />
    <add key="PicTureTye" value=".jpg|.gif|.png|.bmp|.psd|.svg|" />
    <add key="FileSizeLimit" value="10240" />
  </appSettings>
    <location path="" overrideMode="Deny">
    </location>
    <system.webServer>
        <security>
            <requestFiltering>
  <!--允许上传文件长度,单位字节(B),默认为30M,最大为2G -->
                <requestLimits maxAllowedContentLength="300000000" />
            </requestFiltering>
        </security>
    </system.webServer>
</configuration>

点击“网站”右边的,管理下打开“配置编辑器”

在“节”选项下找到system.webServer/security/requestFiltering

编辑requestLimits下的maxAllowedContentLength。默认为30M。修改后点击“应用”

 1

2、在节“system.web/httpRuntime” 下修改,单位是KB

2