Link to home
Start Free TrialLog in
Avatar of c0rrupti0n
c0rrupti0n

asked on

Use URL to open a remote textfile using OpenTextFile function?

Im trying to open a textfile on a remote location...
This is what I've come up with... But it doesnt work...

Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set otf=fso.OpenTextFile("http://mywebsite/folder/index.html",1,false)

Are there any other alternatives that anyone can think of?

Thanks for your time...
Avatar of Gary
Gary
Flag of Ireland image

FSO is for local files only
<%
Set objXMLHTTP = server.CreateObject("Microsoft.XMLHTTP")
 
objXMLHTTP.Open "post", "http://www.intouchmedialtd.com/file.txt", False
objXMLHTTP.Send

PageContent = objXMLHTTP.responseText
response.write pagecontent
%>
Avatar of c0rrupti0n
c0rrupti0n

ASKER

Well I tried your example (GaryC123) and no go... I keep getting an error HTTP/1.0 501 Not Implemented in my browser. I did some research and found similar examples http://www.w3schools.com/dom/dom_http.asp. However those didnt seem to work either. I then came across this...

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q237/9/06.ASP&NoWebContent=1

I believe this might be why its not working... and even if it did Im still uncertain it would work out because I need to use the OpenTextFile function in FSO.

Im trying to grap a text file from a remote web server. Parse it to find certain text in the files.

I need the use of the follow Sub functions of OpenTextFile:

Read
Skipline
Skip

Thanks for the swift response...
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial