Forum Moderators: open
I have uploaded this script to my host and when i run it I get this error
Scripting.FileSystemObject.1 error '80070005'
You are not permitted to access a file which is not located within your ASP application's root.
What directory do you think they might be referring too?
Any help appreciated
Thank You
Colin
<code>
Const fsoForAppend = 8
Dim Stuff, myFSO, WriteStuff
'this is what we will write in the file
Stuff = ""
Stuff = Stuff & dateTimeStamp & ","
Stuff = Stuff & dictFields.Item( "SelectCity" ) & ","
Stuff = Stuff & dictFields.Item( "Workshop1" ) & ","
Stuff = Stuff & dictFields.Item( "Workshop2" ) & ","
Stuff = Stuff & dictFields.Item( "Salutation" ) & ","
Stuff = Stuff & dictFields.Item( "FirstName" ) & ","
Stuff = Stuff & dictFields.Item( "LastName" ) & ","
Stuff = Stuff & dictFields.Item( "Title" ) & ","
Stuff = Stuff & dictFields.Item( "CompanyName" ) & ","
Stuff = Stuff & dictFields.Item( "CompanyAddress" ) & ","
Stuff = Stuff & dictFields.Item( "Suburb" ) & ","
Stuff = Stuff & dictFields.Item( "PostCode" ) & ","
Stuff = Stuff & dictFields.Item( "PhoneNumber" ) & ","
Stuff = Stuff & dictFields.Item( "Mobile" ) & ","
Stuff = Stuff & dictFields.Item( "EmailAddress" ) & VbCrLf
Response.write Stuff
'this line creates an instance of the File Scripting Object named myFSO
Set myFSO = Server.CreateObject("Scripting.FileSystemObject")
'this line opens the file, notice the 8, it will cause the script to append to the file
Set WriteStuff = myFSO.OpenTextFile( "/home/bdweb8083m/johnstonefamily/public_html/participants.txt", fsoForAppend, True)
'this line actually writes STUFF from above to the file
WriteStuff.WriteLine Stuff
'this line closes the file
WriteStuff.Close
'this line destroys the instance of the File Scripting Object named WriteStuff
SET WriteStuff = NOTHING
'this line destroys the instance of the File Scripting Object named myFSO
SET myFSO = NOTHING
</code>