ASP want to overwrite or delete contents of file before writing to it
Posted on 2006-05-16
I have a form that sends the data to a text file. The data currently gets written in the text file below the last entry
What I would like to do is only have the current data populate that file. So I must delete the file and create a new one
or overwrite the data in the current file.
Here is my code
If Request.Form("action") = "approved" then
path = "C:/textfolder/"
'after insert database :
path =path & stros
stros = request.form("hcodeline")
set fs = server.createobject("scripting.filesystemobject")
set txt = fs.opentextfile(path&stros&".txt",8,true,false)
set fs = nothing