У меня есть форма, которая на submit отправляется в tst.asp, в tst.asp я использовал Request.Form («ac»), чтобы получить значение текстового поля с предыдущей страницы. Значение текстового поля копируется из текстового файла. На странице tst.asp я получаю значение и записываю его в другой .txt file.it работает нормально, если нет линий меньше 900. Если эти линии пересекаются выше 900, тогда я получаю сообщение об ошибке. msg «Ошибка объекта-объекта» ASP 0104: 80004005. Операция не разрешена. /CAPMAdjustments/arpit1.asp, строка 8 " Строка 8 - текстtoinsert1 = Request.Form («ac»). Так что кто-нибудь может помочь мне с этой проблемой. Ниже приведен код, который я написал.classic asp Request.Form («ac») бросает ошибку выше 900 строк
<%@ 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
%>
Много вопросов уже на эту тему - http://stackoverflow.com/a/22386054/692942, http://stackoverflow.com/a/31525087/692942, HTTP: // StackOverflow. com/a/1849202/692942 – Lankymart
Возможный дубликат [Полный сбой при достижении request.form] (http://stackoverflow.com/questions/17310915/complete-failure-when-reaching-request-form) – Lankymart