Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using fso with http

Status
Not open for further replies.

ktwclark

Programmer
Jan 30, 2002
54
GB
I'm having a problem getting the filesystemobject to open a text file sitting in my web folder. Is this a limitation of the fso, it works when the drive letter is specified but not when the URL is used. Any ideas?

Here's the code:

<SCRIPT language=VBScript>
<!--
Sub ReadWriteText_OnClick()
Dim fso, f1, ts, s

'Open file and read contents
Set fso = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set ts = fso_OpenTextFile(&quot; 1)
s = ts.ReadLine
msgbox &quot;File contents = '&quot; & s & &quot;'&quot;
ts.Close

'Open file for writing
Set f1 = fso_OpenTextFile(&quot; 2, True)
s = s + 1
f1.WriteLine s
f1.WriteBlankLines(1)
f1.Close
msgbox &quot;File contents = '&quot; & s & &quot;'&quot;
End Sub
-->
</SCRIPT>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top