0

I have an form which on submit goes to tst.asp ,in tst.asp i was using Request.Form("ac") to get the value of an text box from previous page.the text box value is being copied from an text file.and in tst.asp page i am geting the value and writing it to an another .txt file.it is working fine if the no of lines is less than 900.if these lines crosses above 900 then i get the error msg "Request object error 'ASP 0104 : 80004005' Operation not Allowed /CAPMAdjustments/arpit1.asp, line 8" line 8 is texttoinsert1 = Request.Form("ac").so can anyone please help me with this issue.below is the code which i wrote.

<%@ 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
%>
  • Plenty of questions already on this topic - http://stackoverflow.com/a/22386054/692942, http://stackoverflow.com/a/31525087/692942, http://stackoverflow.com/a/1849202/692942 – user692942 Sep 23 '16 at 09:13
  • 1
    Possible duplicate of [Complete failure when reaching request.form](http://stackoverflow.com/questions/17310915/complete-failure-when-reaching-request-form) – user692942 Sep 23 '16 at 09:22

1 Answers1

2

Its because might your request content is more then limit set in IIS. Try to increase Maximum Requesting Entity Body Limit. It need to be set in bytes.

enter image description here

Hardipsinh Jadeja
  • 1,180
  • 1
  • 13
  • 30