现在的位置: 首页 > 综合 > 正文

ASP 堆栈溢出的解决方法

2013年12月02日 ⁄ 综合 ⁄ 共 2026字 ⁄ 字号 评论关闭

今天内部网,发现个错误:

请求对象 错误 'ASP 0107 : 80004005'

堆栈溢出

/admin/FileEdit1.asp,行14

处理中的数据超过允许的极限。

 

 

原来这句:'Content=Request.Form("Content")

改成下面的,就OK了

 

Dim BigTextArea , I

For I = 1 To Request.Form("Content").Count
  BigTextArea = BigTextArea & Request.Form("Content")(I)
Next

Content = BigTextArea

 

 

 

 

 

 

引用

 

网上看到篇文章如下,我发现是不对的

//////////////////////////////////////////////
本人今天碰到神经了。写了个提交表单,提交时候发现超过100K提交既然会出错

晕。。
具体错误对象是:
错误 'ASP 0107 : 80004005' 堆栈溢出
处理中的数据超过允许的极限。

错误 'ASP 0107 : 80020009'  
发生意外

下面是我找到的最好的解决方法
这是前台代码
__________________________________
<FORM method=post action=LargePost.asp name=theForm onsubmit="BreakItUp()">
<Textarea rows=3 cols=100 name=BigTextArea>A bunch of text...</Textarea>
<input type=submit value=go>
</form>

<SCRIPT Language=JavaScript>
function BreakItUp()
{
//Set the limit for field size.
var FormLimit = 102399

//Get the value of the large input object.
var TempVar = new String
TempVar = document.theForm.BigTextArea.value

//If the length of the object is greater than the limit, break it
//into multiple objects.
if (TempVar.length > FormLimit)
{
document.theForm.BigTextArea.value = TempVar.substr(0, FormLimit)
TempVar = TempVar.substr(FormLimit)

while (TempVar.length > 0)
{
var objTEXTAREA = document.createElement("TEXTAREA")
objTEXTAREA.name = "BigTextArea"
objTEXTAREA.value = TempVar.substr(0, FormLimit)
document.theForm.appendChild(objTEXTAREA)

TempVar = TempVar.substr(FormLimit)
}
}
}
</SCRIPT>

____________________________________________________________________________________
ASP接收处!
<%
Dim BigTextArea

For I = 1 To Request.Form("BigTextArea").Count
BigTextArea = BigTextArea & Request.Form("BigTextArea")(I)
Next
%>

终于解决啦。。看你还牛。。
////////////////////////////////////////

根本原因是
我们以前遇到过这种情况,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).

抱歉!评论已关闭.