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!

Save text from input box as a text file 1

Status
Not open for further replies.

jon24422531

Technical User
Jan 27, 2004
295
0
0
GB
Hi everyone
I have struggled with this for some time. I wish a visitor to my site to be able to write some text in a box that can then be saved to a text file in another folder on the server for use in another process. I have scoured the web but the only solution I could find did not really fit the bill. I am not even sure if ASP is the best solution and should I try JavaScript? Thanks for your help.
Jonathan

Jon
 
Use something like this:

Code:
<% 
dim oFSO, oFile,oField
dim strOutput

set oFSO = server.createobject ("scripting.filesystemobject")
set oFile = oFSO.createtextfile("c:\file.txt",true)

stroutput = "this is the text in the file"

ofile.writeline stroutput
ofile.close
set oFile = nothing
set oFSO = nothing
%>
 
Doorbreaker (where do you get these names?)

Great stuff, that has set me on the right track, many thanks.

Jon
 
Thanks from me too doorbreaker! All I wanted to do was write a string var to a text file and that small example was perfect.

flize
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top