【问题标题】:classic asp Request.Form("ac") is throwing error above 900 lines经典的 asp Request.Form("ac") 在 900 行以上抛出错误
【发布时间】:2016-09-23 08:26:38
【问题描述】:

我有一个提交到 tst.asp 的表单,在 tst.asp 中我使用 Request.Form("ac") 从上一页获取文本框的值。正在复制文本框的值从文本文件。在 tst.asp 页面中,我获取值并将其写入另一个 .txt 文件。如果行数小于 900,它工作正常。如果这些行超过 900,那么我得到错误信息 “请求对象错误‘ASP 0104:80004005’ 不允许操作 /CAPMAdjustments/arpit1.asp,第 8 行" 第 8 行是 texttoinsert1 = Request.Form("ac").so 谁能帮我解决这个问题。下面是我写的代码。

<%@ 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
%>

【问题讨论】:

标签: asp-classic


【解决方案1】:

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

【讨论】:

  • 前面已经回答了很多详细的不需要再回答了。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-12-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-10-06
相关资源
最近更新 更多