配置文件

. web.config中添加如下内容:

1 <configuration>
2   <system.web>
3      <httpRuntime maxRequestLength="2097151" executionTimeout="120"/>
4   </system.web>
5 </configuration>
View Code

说明:
httpRuntime 配置 ASP.NET HTTP 运行时设置,以确定如何处理对 ASP.NET 应用程序的请求。
maxRequestLength (指示 ASP.NET 支持的最大文件上载大小)
指定输入流缓冲阈值限制(以 KB 为单位)。此限制可用于防止拒绝服务攻击;例如,因用户向服务器发送大型文件而导致的拒绝服务攻击。
默认值为 4096 (4 MB),最大值只能是2097151K。
executionTimeout:指定在被 ASP.NET 自动关闭前,允许执行请求的最大秒数。默认90秒。
只有当 compilation 元素中的调试属性为 False 时,此超时属性才适用。若要帮助避免在调试期间关闭应用程序,请不要将此超时属性设置为较大值。
 
3. web.config中,把以下内容加在<system.webServer>节点
 

1 <security>
2 <requestFiltering >
3 <requestLimits maxAllowedContentLength="2147483647" ></requestLimits>
4 </requestFiltering>
5 </security>
6  
7 上述中maxAllowedContentLengt是以BK为单位。
View Code

注:部分资料参考网络资料

posted on 2013-08-09 18:00  高兴happy  阅读(676)  评论(0编辑  收藏  举报