Save a file with a form field value

M

Mike

I have a form with the folowing code in it to save a text file to the
server. I currently have
the file named 'test.txt'. is there a way to save the file with its name
being the name of one of the fields? For example I want the name of the file
to be the persons last name.

set FSO = Server.CreateObject("scripting.FilesystemObject")
set myFile = fso.CreateTextFile("C:\test.txt", true)
myFile.WriteLine(request.form("FirstName") & Chr(9) &
request.form("LastName"))
myFile.Close

Thanks in advance,

Mikeal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top