DodgeIntrepid.Net Forums banner

1 - 6 of 6 Posts

·
Registered
Joined
·
145 Posts
Discussion Starter #1
Hello again,
this is a question for anyone who is familiar with asp filesystemobject.

Ok this is my code so far.

dim ObjFSO,strPath,ObjOpenFile
*strPath = Server.MapPath("info.txt")
set objFSO = server.CreateObject("Scripting.FileSystemObject")
set ObjOpenFile = ObjFSO.OpenTextFile(strPath,8,false)
ObjOpenFile.Writeline (Request.Form("txtname"))
ObjOpenFile.close
set ObjOpenFile = nothing
set ObjFSO = nothing

this works perfectly by putting information in a .txt file that was created in the same directory as the forum pages by using(Server.MapPath("info.txt"). now what i want to do is, instead of storing the information on the same server, is it possible to store it into a internal folder. i tried certain paths but it gives me path errors.
fp = "C:\AppLogs"
strPath = fp & "info.txt"

am i missing something in the filepath?
im running IIS, win2k
thanks again,
 

·
Registered
Joined
·
229 Posts
Just a wild guess, but have you tried changing

fp = "C:\AppLogs"

to

fp = "C:\AppLogs\"

?

The reason I ask is that as it stands now,

strPath = fp & "info.txt" (this is C:\AppLogsinfo.txt)


Just an idea. Let me know how (if) it works.
 

·
Registered
Joined
·
145 Posts
Discussion Starter #4
Hi,
Ya i have C:\AppLogs\ on my original, but it doesn't work. im starting to think the only place where you could save it is under the server...
 

·
Registered
Joined
·
229 Posts
I'm no code monkey, but I know you can access files in other locations than just on the server. Check this out and see if it helps.

Also, do a search for "FSO ASP" (minus the quotes) on Yahoo or whatever you use and you'll come up with a ton of tutorials and examples.
 
1 - 6 of 6 Posts
Top