经典的asp Request.Form(“ac”)抛出超过900行的错误

时间:2016-09-23 08:26:39

标签: asp-classic

我有一个表单,提交到tst.asp,在tst.asp我正在使用Request.Form(“ac”)从前一页获取文本框的值。正在复制文本框值从文本文件。在tst.asp页面我正在调整值并将其写入另一个.txt文件。如果行数小于900,则工作正常。如果这些行超过900,那么我得到了错误消息 “请求对象错误'ASP 0104:80004005' 操作不允许 /CAPMAdjustments/arpit1.asp,第8行“ 第8行是texttoinsert1 = Request.Form(“ac”)。所以任何人都可以帮我解决这个问题。下面是我写的代码。

<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<%
FileName = Request.QueryString
Dim FSO
set FSO = server.createObject("Scripting.FileSystemObject") 
if FSO.FileExists(FileName) Then
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim file    
set file = FSO.GetFile(FileName)
Response.Write FileName
Dim sScriptLocation, sScriptName, iScriptLength, iLastSlash
set sScriptLocation = Request.QueryString
iLastSlash      = InStrRev(sScriptLocation, "\")
iScriptLength   = Len(sScriptLocation)
sScriptName     = Right(sScriptLocation, iScriptLength - iLastSlash)
fname=Replace(sScriptName, ".txt", " ")
Response.Write fname 
Dim TextStream
Set TextStream = file.OpenAsTextStream(ForReading, TristateUseDefault)
%>
<FORM action="tst.asp" id="form1" method=post name="form1">
<input type="hidden" name="ac" id="ac" value="">
<input type="textbox" name="fn" id="fn" value='<%=fname%>'>
<button onclick=abc();>save</button>
<textarea rows="100" cols="230" contenteditable>     
<%  
Do While Not TextStream.AtEndOfStream  
Dim Line
Line = TextStream.readline
Response.write "|" 
Line = Line & vbCRLF
Response.write Line
Loop
%>
</textarea>
</form >
<%
Response.Write "</pre><hr>"
Set TextStream = nothing
Else
End If
Set FSO = nothing
%>
</FONT>
</BODY>
<script type="text/javascript" >
function abc()
{
var contenteditable = document.querySelector('[contenteditable]'),
text1 = contenteditable.textContent;
document.getElementById("ac").value=text1;
alert(text1);
}
</script></HTML>
tst.asp page code is as follows
<%@ LANGUAGE="VBSCRIPT" %>
<%Dim FSO
set FSO = server.createObject("Scripting.FileSystemObject") 
Dim ts  
Dim a
texttoinsert1 = Request.Form("ac")
fname = Request.Form("fn")
Dim fname, lname, name
lname = "A"
name = Request.Form("fn")+lname
str = Replace(name, " ", "")
set ts = FSO.CreateTextFile("E:\applications\FTP\Archive\"+str+".txt",true)
a=Split(texttoinsert1,"|")
for each x in a
ts.Write x 
next
ts.Close()
Response.Write "YOUR FILE HAS BEEN SAVED SUCCESFULLY WITH NAME:" &str
%>

1 个答案:

答案 0 :(得分:1)

因为您的请求内容可能会超过IIS中的限制设置。尝试增加最大请求实体正文限制。它需要以字节为单位进行设置。

enter image description here