Reading in a file using asp

Discussion in 'ASP General' started by Igor Zelfon, Sep 9, 2003.

  1. Igor Zelfon

    Igor Zelfon Guest

    I have the following code in an asp that just seems to hang when executed.
    When I disable the "Set theFileReader = fileObj.OpenTextFile(contentFile,1,True)"
    line, I see that the file exists.
    I am running this on Windows 2000 with IIS Server.
    Any help would be appreciated

    <%



    Dim fileObj, contentFile, textFileLoc, theFileReader, rate
    Set fileObj = Server.CreateObject("Scripting.FileSystemObject")
    textFileLoc = "blah.txt"
    contentFile = Server.MapPath(textFileLoc)
    If fileObj.FileExists(contentFile) then
    Response.Write("File " + contentFile + " exists")
    Set theFileReader = fileObj.OpenTextFile(contentFile,1,True)
    rate = theFileReader.ReadLine
    theFileReader.Close
    Set theFileReader=Nothing
    Set fileObj=Nothing

    Else
    Response.Write("File " + contentFile + " does not exist")

    End If








    %>


    RATE IS: <%=rate%>
    Igor Zelfon, Sep 9, 2003
    #1
    1. Advertising

  2. Igor Zelfon

    Ray at home Guest

    http://www.aspfaq.com/2180

    Ray at home

    "Igor Zelfon" <> wrote in message
    news:...
    > I have the following code in an asp that just seems to hang when executed.
    >> Set fileObj = Server.CreateObject("Scripting.FileSystemObject")
    Ray at home, Sep 9, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darrel
    Replies:
    3
    Views:
    650
    Kevin Spencer
    Nov 11, 2004
  2. Wael Soliman

    ASP.NET Reading problem (reading .xls)

    Wael Soliman, Jan 3, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    4,776
    =?Utf-8?B?dmluYXk=?=
    Jan 3, 2005
  3. Replies:
    0
    Views:
    763
  4. Karim Ali

    Reading a file and resuming reading.

    Karim Ali, May 25, 2007, in forum: Python
    Replies:
    2
    Views:
    351
    Hrvoje Niksic
    May 25, 2007
  5. Replies:
    3
    Views:
    84
    David Squire
    Aug 5, 2006
Loading...

Share This Page