c# 上传附件大小限制的问题

在c# 相关的asp.net 中。需要设置附件的大小。需要修改2部分。

1.修改metabase.XML

以Windows2003 为例子。 打开 C:\Windows\System32\Inetsrv 下的 metabase.XML文件。

 并修改AspMaxRequestEntityAllowed 为你需要的值(‘1073741824’,1GB)

2.修改.net中

在web.config文件中添加一个httpRuntime 主键。

 具体位置为 <system.web>

  <httpRuntime maxRequestLength="2087100">

  </httpRuntime>

</system.web>

其它设置大小的问题,由于时间原因,没有验证,以后有机会更新。