在web.config中添加httpRuntime元素,如下:
<configuration>
<system.web>
<httpRuntime maxRequestLength="8192"
useFullyQualifiedRedirectUrl="true"
executionTimeout="45"
versionHeader="1.1.4128"/>
</system.web>
</configuration>
其中maxRequestLength属性就是限制上传大小的,如设为"8192"即为8M。
转载于:https://www.cnblogs.com/pyt5208/archive/2006/07/10/446994.html