View Single Post
  #1  
Old 07-31-2006, 04:54 PM
nirvana nirvana is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
nirvana is on a distinguished road
Default text file into textfile

Please give your suggestions


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
-- 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 into textfile
View Single Post
  #1  
Old 07-31-2006, 04:54 PM
nirvana nirvana is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
nirvana is on a distinguished road
Default text file into textfile

Please give your suggestions


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
-- 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