Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

writing problem to large amount text to text file 1

Status
Not open for further replies.

walkerdigest

Programmer
Feb 10, 2009
35
0
0
TR
I need to write to text file. I'm creating file with Createtextfile with (,2) permission . I am getting text with <textarea> and write to txt file with writeln.

I need to write large amount txt but I'm failed. It accepts certain amount of number of lines then I can not write rest of text. What can you suggest?

If you answer ASAP , I appreciate.
 
can you provide what you've written so far?

TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
 
<%
kmt=request.QueryString("kmt")
ykfaaliyetraporu=request.QueryString("ykfaaliyetraporu")


if kmt="kaydet" then
Set YaziFSO=CreateObject("Scripting.FileSystemObject")
Set DosyaYaz=YaziFSO.CreateTextFile("c:\inetpub\ DosyaYaz.WriteLine(replace(ykfaaliyetraporu,VbCrLf,"<br>"& VbCrLf))
DosyaYaz.close
end if

Set OkuFSO=CreateObject("Scripting.FileSystemObject")
Set DosyaOku=OkuFSO.OpenTextFile("c:\inetpub\ if not DosyaOku.AtEndOfStream then
icerik=DosyaOku.ReadAll
end if
DosyaOku.close
set OkuFSO= Nothing
set DosyaOku= Nothing
%>


<form action="yonetimkurulu_fr_vt.asp" method="get">
<table width="440" border="1" cellspacing="0" cellpadding="0">
<caption align="top">
YÖNET?M KURULU FAAL?YET RAPORU
</caption>
<tr>
<td>&nbsp;<textarea cols="100" rows="50" name="ykfaaliyetraporu" style=" size:auto;"><%=replace(icerik,"<br>" & VbCrLf , VbCrLf)%></textarea></td>
</tr>
<tr>
<td>&nbsp;<input type="submit" name="kmt" value="kaydet" /></td>

</tr>
</table>
 
first, you should pass the value by a post command rather than a get because querystrings are restricted to ~255 characters.

second, you need to read the values by request.form instead of request.querystring

third, put the "reading" of the text file within you if/end code block.

I've made these adjustements for you below, hope it helps

Code:
<%
   kmt=request.form("kmt")
   ykfaaliyetraporu=request.form("ykfaaliyetraporu")
      
   if kmt="kaydet" then
       Set YaziFSO=CreateObject("Scripting.FileSystemObject")
       Set DosyaYaz=YaziFSO.CreateTextFile(server.mappath("yonetimkurulu.txt"),2)
       DosyaYaz.WriteLine(replace(ykfaaliyetraporu,VbCrLf,"<br>"& VbCrLf))
       DosyaYaz.close
   
   Set OkuFSO=CreateObject("Scripting.FileSystemObject")
   Set DosyaOku=OkuFSO.OpenTextFile(server.mappath("yonetimkurulu.txt"),1)
   if  not DosyaOku.AtEndOfStream then 
       icerik=DosyaOku.ReadAll
   end if
   DosyaOku.close
   set OkuFSO= Nothing
   set DosyaOku= Nothing
end if 
   
  %>


<form action="yonetimkurulu_fr_vt.asp" method="post">
<table width="440" border="1" cellspacing="0" cellpadding="0">
  <caption align="top">
    YÖNETIM KURULU FAALIYET RAPORU
  </caption>
  <tr>
    <td>&nbsp;<textarea cols="100" rows="50" name="ykfaaliyetraporu" style=" size:auto;"><%=replace(icerik,"<br>" & VbCrLf , VbCrLf)%></textarea></td>
  </tr>
  <tr>
    <td>&nbsp;<input type="submit" name="kmt" value="kaydet" /></td>

  </tr>
</table>

TIP: trying googling the answer before posting, you'll find that more times than not someone else somewhere has had the same request and posted an answer online.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top