一、修改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