Opening a text file from elsewhere on the web

Results 1 to 3 of 3

Thread: Opening a text file from elsewhere on the web

  1. #1
    Tim Warke Guest

    Default Opening a text file from elsewhere on the web

    Hi, I am trying to set up streaming content from another site on the web<BR><BR>They have given me the URL of their text file.<BR><BR>How can i open it to read the information in it.<BR><BR>Can FSO be used?<BR><BR>If so what is the syntax.<BR><BR>Thanks<BR><BR>Tim

  2. #2
    Join Date
    Dec 1969

    Default RE: Opening a text file from elsewhere on the web

    1. you could try using FSO object in reading the txt file on other server. The issue might be the access rights. any how you could try, here is the code that i used to open txt file in my server (for other server: you might want to type the entire directory path like<BR><BR>2. another way to do this is ftp the file into your server and then read it from your server. use the code below to read the file. for FTP, there are multiple ways you could do this. There is lot of info on the web. <BR>***********<BR> File_with_Udp_data=server.mappath("data")<BR>&#039 "data" is the folder in which my txt file is in. also this folder "data" is one level below the folder where this .asp file resides.<BR> if right(File_with_Udp_data,1)="/" or right(File_with_Udp_data,1)="\" then<BR> File_with_Udp_data=File_with_Udp_data & "employee.txt"<BR> else<BR> File_with_Udp_data=File_with_Udp_data & "employee.txt"<BR> end if<BR><BR> Set fs=CreateObject("Scripting.FileSystemObject")<BR> &#039if file dosn&#039t exit then create the file<BR> if fs.fileExists(File_with_Udp_data) then <BR> set filetemp=fs.OpentextFile(File_with_Udp_data)<BR>&# 039insert code to read the file<BR> filetemp.close<BR> end if

  3. #3
    Join Date
    Dec 1969

    Default No, FSO cannot be used.

    FSO is only useable on the machine it&#039s being run from. You would more than likely need a component such as ASPTear. It uses HTTP to mimic itself as a browser viewing the site. You can then do what you need to the info on the page.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts