Solved

Use URL to open a remote textfile using OpenTextFile function?

Posted on 2003-11-12
3
888 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
  • 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 20 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now