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

reading from file on server

Status
Not open for further replies.

lleemon

Programmer
Mar 26, 2002
21
GB
I am wondering if the following can happen:

If I have a upload utility to put a .txt file onto my server, can I upload a .txt file to a certain location. When this is done I want to open a .asp page that when I hit a button reads the .txt file values and populates a page, db, etc... My main question is if a asp can read in a .txt file like vb can?

Thanks in advance.
 
Sure can. You might want to use something like this:

==========================================================

Function ReadEntireFile(filespec)
Const ForReading = 1
Dim fso, theFile, retstring
Set fso = CreateObject("Scripting.FileSystemObject")
Set theFile = fso_OpenTextFile(filespec, ForReading)

Do While theFile.AtEndOfStream <> True
retstring = retstring + theFile.ReadLine
Loop

theFile.Close
ReadEntireFile = retstring
End Function
==========================================================
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top