This topic is locked

custom label w/OpenTextFile(Server.MapPath("text")

9/16/2015 1:01:04 PM
ASPRunnerPro General questions
J
jeffstev author

I can get this working great:
Set fs = CreateObject("Scripting.FileSystemObject")

Set wfile = fs.OpenTextFile(Server.MapPath("LASTATS.TXT"))

msg_status = wfile.ReadAll

wfile.close

Set wfile=nothing

Set fs=nothing

strValue = msg_status
but I really need to access the LASTATUS.TXT file on a remote server. I tried:

Set wfile = fs.OpenTextFile(Server.MapPath("text") & "http://duckhorn/voicemailaccounts/armida/LASTATS.TXT",1)
but this gives me an "access error" as does a fully qualified path like \\server\dir\filename.txt. you can only reference files relative to the server the webserver is running on.
does anyone know the right way to load a single line remote file into a variable using http?
any help appreciated.