Asp.Net配置Web.Config更改默认上传文件大小限制!(适用于win7\win2003的IIS)

Asp.Net配置Web.Config更改默认上传文件大小限制!(适用于win7\win2003的IIS)

 <system.web>

	  <httpRuntime  maxrequestLength="1073741824" executionTimeout="3600"/>  <!--maxRequestLength就是文件的最大字符数,最大值不能超过2个G左右,executionTimeout是超时时间-->

    <compilation debug="true" targetFramework="4.0" />
  </system.web>


以下是网上其他人的答案,仅供参考:


修改IIS的applicationhost.config
    打开 %windir%/system32/inetsrv/config/applicationhost.config 
     找到: <requestFiltering>节点,
  这个节点默认没有 <requestLimits maxAllowedContentLength="上传大小的值(单位:byte)" /> 元素,IIS 7和IIS 7.5上测试过  最大值只能是<requestLimits maxAllowedContentLength="4294967295" />  <4GB,
     为这个节点新增如下事例元素:<requestLimits maxAllowedContentLength="2147483647" /> ,上传的大小将改为2G
注意: %windir%/system32/inetsrv/config/applicationhost.config 文件一定不要用其他机器的文件替换,否则IIS将无法启动
此文件记录了,当前IIS中所有Site , App pool的信息,还有一些与机器相关的配置。


web.config下如果有如下节点(此节点是为IIS 7设计的) ,则修改
<requestLimits maxAllowedContentLength="2147483647" /> 单位与applicationhost.config中的<requestLimits maxAllowedContentLength="2147483647" />一致,它的最大值也只能为4294967295
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2147483647" />
</requestFiltering>
</security>
</system.webServer>

总结:asp.net(IIS 7 and IIS 7.5)上传文件的最大值不能超过2GB


  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

敦厚的曹操

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值