风易博客

风萧萧兮易水寒, 壮士一去兮不复还。

« dbf表导入SQLSERVER超女 花未红蕊已谢 »

提交大表单数据提示ASP 0107 (0x80004005)

会说话的博客,点我试试:)

今天遇到一个怪事,上传大数据时提示发生意外,

请求对象, ASP 0107 (0x80004005)
数据处理已超过允许的限制。

记得这个问题是在把项目从2003平台迁移到2000上时发生的事情, 2003可以修改上传最大值限制,而2000遍寻不获,从微软官方网站发现问题,特贴出留记.

PRB: Error " Request 对象, ASP 0107 (0x80004005) " 时发布窗体

症状


当张贴在 Microsoft Internet Information Services 5.0, 大型表单域可能会收到以下错误信息:
错误类型:
请求对象, ASP 0107 (0x80004005)
数据处理已超过允许的限制。
当张贴 Microsoft Internet Information Server 4.0, 中大表单字段可能会收到以下错误信息:
请求对象错误 ASP 0107: 80004005''
堆栈溢出
/projectname/page.asp, 行 .XX
数据处理已超过允许的限制。

回到顶端

原因


大小限制的被 请求 对象中检索每个窗体域是 102,399 字节。 当超过该限制时发生错误。

回到顶端

解决方案


要解决此问题, 请使用下列方法之一:
不用读取表单使用 Request.Form 集合, 变量值使用 Request.BinaryRead (Request.TotalBytes) , 并分析来自 Request.BinaryRead 的输出形式值。
使用文件上载方案, Microsoft PostingAcceptor 如。
HTML 表单变量之前您提交表单断开到多个窗体变量。 对于每个窗体变量, 102,399 字节限制是多表单变量的 102,399 字符以内因此您可具有。 以下示例代码阐释此: WARNING BY USE 任何 CODE 按 IN THIS ARTICLE IS AT YOUR OWN RISK 你 OF THE: Microsoft 提供此代码 " 按原样 " 担保的任何类型, 明示或暗示, 包括但不限于适销性和/或用于特定目的适用性的暗示保证。
<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>
接收 Active Server Page (ASP) 页 reconstructs 变量:
<%
Dim BigTextArea
For I = 1 To Request.Form("BigTextArea").Count
BigTextArea = BigTextArea & Request.Form("BigTextArea")(I)
Next
%>

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80722 Code detection by Codefense  theme by BokeZhuti

Copyright © 2005 - 2008 风易博客 1982Y.Net.Cn All Rights Reserved.  由Wind88.Net提供优质主机空间
沪ICP备05006417号