Thread: text file....
View Single Post
  #1  
Old 07-30-2006, 11:44 AM
bono bono is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
bono is on a distinguished road
Default text file....

Hello members

I'm a novice asp coder. I've got a web page that have a <textarea> that I need to populate with what is in a text file. For now, I just want to Read the text file into the textarea, but I just can't seem to get it to work. Here's what I've got:

Code:
Function getFile(fileThis)
dim Filename

Filename = "someFile.txt"
'format is data1|data2

Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0

' Create a filesystem object
Dim fso
set fso = server.createObject("Scripting.FileSystemObject")

' Map the logical path to the physical system path
Dim Filepath
Filepath = Server.MapPath(Filename)

if fso.FileExists(Filepath) Then
' Get a handle to the file
Dim fil -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - text file....
Thread: text file....
View Single Post
  #1  
Old 07-30-2006, 11:44 AM
bono bono is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
bono is on a distinguished road
Default text file....

Hello members

I'm a novice asp coder. I've got a web page that have a <textarea> that I need to populate with what is in a text file. For now, I just want to Read the text file into the textarea, but I just can't seem to get it to work. Here's what I've got:

Code:
Function getFile(fileThis)
dim Filename

Filename = "someFile.txt"
'format is data1|data2

Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0

' Create a filesystem object
Dim fso
set fso = server.createObject("Scripting.FileSystemObject")

' Map the logical path to the physical system path
Dim Filepath
Filepath = Server.MapPath(Filename)

if fso.FileExists(Filepath) Then
' Get a handle to the file
Dim fil -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote