windows 2008 server iis7 服务上传文件大小限制

windows 2008 server iis7 服务上传文件大小限制

一、修改iis7 上传大文件限制

修改C:/Windows/System32/inetsrv/config/schema/IIS_schema.xml文件(修改该文件需要获得这个文件的控制权),找到maxAllowedContentLength, 其默认值为30000000,即30M,加一个0 就变成了 300MB 了就应该够用了,如果不起作用,则需要重启 IIS 7即可:

       <element name="requestLimits">
           <attribute name="maxAllowedContentLength" type="uint" defaultValue="30000000" />
           <attribute name="maxUrl" type="uint" defaultValue="4096" />
          <attribute name="maxQueryString" type="uint" defaultValue="2048" />
          <element name="headerLimits">
          <collection addElement="add" clearElement="clear" removeElement="remove" >
             <attribute name="header" type="string" required="true" isUniqueKey="true" validationType="nonEmptyString" />
             <attribute name="sizeLimit" type="uint" required="true" />
          </collection>
      </element>

二、IIS7.0的修改方法如下:
打开IIS管理器–双击“IIS”中的“ASP”– 打开“配置 ASP 应该程序的属性”–展开“限制属性”;修改“最大请求实体主体限制”的值,默认值为200000(即不到200KB);把它修改为你想修改的大小

或者在ASP.net的web.config添加:

  <system.web>    

    <!-- 设置可上传的最大文件大小 -->

    <httpRuntime maxRequestLength="1048576" requestValidationMode="2.0" />

  </system.web>

 

参考:http://hi.baidu.com/skycell/item/04a47e32ddfc94f7e6bb7a07

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值