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!

Hello: I creating a txt file int

Status
Not open for further replies.

lilita0

Programmer
Sep 5, 2003
9
0
0
MX
Hello:

I creating a txt file into my local drive. My code is the following:
<%
dim filesys, filetxt, Strinfo
Strinfo= Request.QueryString(&quot;qStr&quot;)
Response.Write(StrInfo)
Const ForReading= 1, ForWriting=2, ForAppending=8
Set filesys=CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set filetxt=filesys.OpenTextFile(&quot;c:\$garra\mitexto.txt&quot;,ForAppending,True)
filetxt.WriteLine(qStr)
filetxt.Close
%>

Where qStr contains this string: ?ReferenceNumber=7&AICC_TRACKING=/learningspace5/tracking/hacp/&AICC_SID=616313237-6900&AICC_URL=http%3A%2F%2Felearnla.ihost.com%2FLearningSpace5%2FProgram%2FScripts%2FTrack.asp

My big problem is when I read the txt file created into my local, the value of qStr has been writen until &quot;?ReferenceNumber=7&quot; but I need the rest of the string to pass the correct value.
I suppose I have to split the string into several strings but I don´t know how to do it.

Hope you can help me.

Thanks in advance.

Liliana
 
so its the & symbol that's breaking it?

[tt]filetxt.WriteLine(Server.HTMLEncode(qStr))[/tt]
or
[tt]qStr = replace(qStr, &quot;&&quot; , &quot;+&quot;)
filetxt.WriteLine(qStr)[/tt]

no idea WHY the & breaks it or even if the above will help :)

Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
I believe it could be breaking because the string is too long!! that what I imagine.

I tried with your code, but my txt file is empty. Do you know what could be happenning???

Thanks a lot.

Liliana
 
well, try something simple:
filetxt.WriteLine(&quot;a simple line of text&quot;)

- can't be much other help, never done file system stuff :)

Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
URLEncode the String as you add it to the Querystring
 
According to the code in your thread:

Strinfo= Request.QueryString(&quot;qStr&quot;)
Response.Write(StrInfo)
filetxt.WriteLine(qStr) -- shouldn't this be....

filetxt.WriteLine(Strinfo)

Not sure if that's a typo in the thread or in your actual code? Just thought I would mention it though.

 
Thank you all for you answer.

Twood, you are just right about the Strinfo, In fact it´s something I have correct by now.

Do you know if my problem with writing more that 20 characters, could be because I am working with the fileSystemObject, and this kind of object needs to define the number of characters that will accept before write it down??

Any idea???

Thanks a lot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top