Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Use URL to open a remote textfile using OpenTextFile function?

Posted on 2003-11-12
3
Medium Priority
?
949 Views
Last Modified: 2010-05-18
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...
0
Comment
Question by:c0rrupti0n
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 9736636
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
%>
0
 
LVL 1

Author Comment

by:c0rrupti0n
ID: 9738653
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...
0
 
LVL 58

Accepted Solution

by:
Gary earned 80 total points
ID: 9738758
If you're having problems with it then use the GET method

<%
Set objXMLHTTP = server.CreateObject("Microsoft.XMLHTTP")
 
objXMLHTTP.Open "get", "http://www.intouchmedialtd.com/product.txt", false
objXMLHTTP.Send

PageContent = objXMLHTTP.responseText
response.write pagecontent
%>

Apart from that there's nothing you can do
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question