set fso = server.createObject("scripting.FileSystemObject")
strFolderCkName = ("c:\test\")
strExportFilename = "export.txt"
If not fso.FolderExists(strFolderCkName) then 'if the folder does not exist, creates it...
fso.createFolder(strFolderCkName)
end if
'Now create a new file
set exportFile = fso.createtextfile(strFolderCkName & strExportFilename,true)
'on error resume next
'write to the file
exportFile.write "Testing writing into a text file" & vbNewline
exportFile.write "This is a field from a form:" & Request.Form("MyFormField") & vbNewLine
You'll also need to add a check that the file doesn't already exist before creating it if you're dumping the details into the same file each time.
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.”
OK I just want to know if what I was told is true in any way. I called into the host and asked them to put the anonymous user account to have permissions to create the file within that directory.
They told me they can do this but that it is a huge security risk because if someone gains access and submits a script into that text file they could gain access to the drive.
Persoanlly this seems a little far fetched but wanted to know if this is real or a host saying things they don't really know?
Ok will just double check with the person that this is a possiblity in theory but that many are configured like this and make sure they still want this feature.
OK the anonymous user has fill permissoins and I still get the same error. I am not to sure where to go from here? ANy suggestions help would be wonderful?
Thanks again for the suggestions so far they have been very helpful in learning this