asp80020009错误

来源:互联网 发布:网络订票怎么取 编辑:程序博客网 时间:2024/05/21 11:26

 我们以前遇到过这种情况,Request.Form提交的数据太多了,导致IIS报告异常“堆栈溢出. 处理中的数据超过允许的极限”。这是因为iis默认设置中最大只能接受200K的内容。是这里造成的原因。

 IIS6 可以做以下调整。

先在服务里关闭iis admin service服务
找到windows/system32/inesrv/下的metabase.xml,
打开,找到ASPMaxRequestEntityAllowed 把他修改为需要的值,默认为204800,即200K
然后重启iis admin service服务

把它修改为51200000(50M)

IIS5.0/4.0 在注册表内 -

Description of the MaxClientRequestBuffer Registry Value
Default Sizes in IIS 4 and 5

In IIS 4.0, the default maximum size of request line and header fields is 2 megabytes (MB).

In IIS 5.0, this is reduced to 128 kilobytes (KB).
In IIS 5.0 with Windows 2000 Service Pack 4 installed, this is reduced to 16 KB.

另外小雨在工作中也找到一种方法,现与大家分享:

提交页面的代码

<SCRIPT Language=javascript>
//分块上传
function FragmentUp()
{
  var tlngFragmentSize  = 51100;//50K
  var tintFragmentCount = 0;
  var tintI             = 0;
  var tstrContent       = new String;
  var tstrOuterHTML     = new String;

  tstrContent           = document.form1.content_html.value;
  tintFragmentCount     = tstrContent.length / tlngFragmentSize + 1;
 
  for(tintI=0;tintI<tintFragmentCount;tintI++){
 tstrOuterHTML = tstrOuterHTML+"<INPUT type=/"hidden/" name=/"F07/">";
  }
 
  document.form1.F07.outerHTML = tstrOuterHTML;
 
  for(tintI=0;tintI<tintFragmentCount;tintI++){
 document.form1.F07[tintI].value = tstrContent.substr(0, tlngFragmentSize);
    tstrContent                     = tstrContent.substr(tlngFragmentSize);
  }
}

</SCRIPT>

<form name="form1">
<input type="hidden" name="F07">
<textarea name="content_html"></textarea>
</form>

后台接收处理的页面代码:

<%
dim content
for i=1 to request("F07").count
    content=content&request("F07")(i)
next
%>

 

 

 

To change the maximum size of a URL request, perform the following to add the MaxClientRequestBuffer registry value:
1. Run the Registry Editor (Regedt32.exe).
2. Locate the following key in the registry:
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/w3svc/parameters
3. From the Edit menu, select Add Value, and then add the following registry value:
Value Name: MaxClientRequestBuffer
Data Type: REG_DWORD
4. In the DWORD Editor dialog box, under Radix, select Decimal. In the Data text box, type the number of bytes for the maximum URL request size.

Note You must restart the IIS service for the changes to take effect.