一般默认在iis的Asp.net站点中,配置文件web.config对上传文件的大小是有限制的,默认最大是 4096K, 也就是4M了
通过对web.config进行配置修改,可以增加上传文件的大小限制。下面是限制4M的配置代码
<httpRuntime maxRequestLength="49600" appRequestQueueLimit="60" executionTimeout="60"/>
maxRequestLength是请求长度也可以说是上传文件大小了。这个代码应该在system.web标签中了,例如web.config的一段如下
- <?xml version="1.0"?>
- <configuration>
- <system.web>
- <globalization requestEncoding="gb2312" responseEncoding="gb2312"/>
- <sessionState mode="InProc" cookieless="false" timeout="20"/>
- <httpRuntime maxRequestLength="47185920"></httpRuntime>
- </system.web>
- </configuration>
本文来自悟空的博客 www.7es.cn