设置IIS7文件上传的限制

来源:互联网 发布:怎样做淘宝直通车 编辑:程序博客网 时间:2024/06/05 08:48

在iis 7 之前,大家都知道,需要修改如下节点

<system.web><httpRuntime maxRequestLength="40960" appRequestQueueLimit="100" useFullyQualifiedRedirectUrl="true" executionTimeout="120" /></system.web>

其中maxRequestLength  为设置允许单个请求最大值  单位为  KB    其最大值为2097151   默认值为 4096(即4M)

如果设置的值超过 2097151  怎会提示以下错误   Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The value for the property 'maxRequestLength' is not valid. The error is: The value must be inside the range 0-2097151


appRequestQueueLimit  为获取或设置一个值,该值指示 ASP.NET 为应用程序排入队列的最大请求数


useFullyQualifiedRedirectUrl 属性指示是完全限定客户端重定向(以 http://server/path 形式),还是将相对重定向发送给客户端。 
当此值为 false 时,某些浏览器在无 Cookie 会话中加载页面时可能会出现问题。


executionTimeout 请求超时时间,单位为秒 默认值为90

ii7/iis7.5 需要同时添加如下节点

<system.webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength="2147483647" /> </requestFiltering> </security></system.webServer>
maxAllowedContentLength它的最大值也只能为4294967295    注意这里的 单位是 B 


原创粉丝点击