在web.config中添加httpRuntime元素,如下:
<configuration>
<system.web>
<httpRuntime maxRequestLength="200"
useFullyQualifiedRedirectUrl="true"
executionTimeout="45"
versionHeader="1.1.4128"/>
</system.web>
</configuration>
其中maxRequestLength属性就是限制上传大小的,如设为"200"即为200KB;设为"8192"即为8192KB=8MB。
8bit(位)=1Byte(字节)
1024Byte(字节)=1KB
1024KB=1MB
1024MB=1GB
1024GB=1TB