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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing a *.txt file on a server

Status
Not open for further replies.

brood

IS-IT--Management
Dec 24, 2005
4
NL
I'd like to know what the best way would be to access (and manipulate) a txt file from a server and displaying it on an html page. Currently I can grab the txt file and place it in a floating frame window, but I need to manipulate it before displaying it. Any ideas?
 
<%
Dim fileObject2, textFile2

' Instantiate a FileSystemObject
Set fileObject2 = Server.CreateObject( _
&quot;Scripting.FileSystemObject&quot; )

' textfile path must be modified to reflect
' the file structure of the server.
textfile = &quot;d:\aspex\&quot; & &quot;textfile.txt&quot;

' Check if the file exists. If not, create it.
If fileObject2.FileExists( textfile ) = True Then

' textfile must be open for reading.
' Open the guestbook, &quot;1&quot; is for reading.
Set textFile2 = fileObject2.OpenTextFile( guestbook, 1 )

' Read the entries from the file and write them to
' the client.
Call Response.Write( &quot;Textfile Entries:<BR>&quot; )
Call Response.Write( textFile2.ReadAll() )
Call textFile2.Close()
End If
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top