Thuurke
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 2/14/2007
-
Status: offline
|
read external textfile
Wednesday, February 14, 2007 9:04 PM
( permalink)
Hello, I want to read an textfile from an external website. After looking around on the internet I found an sort of solution with XMLHTTP. I use Set xml = Server.Createobject("Microsoft.XMLHTTP") xml.open "GET", http:// www.remotesite.com/test.txt, False xml.send to open the file. This works fine, but when the file doesn't exist my script fails. I haven't found an solution to first check if the file exists. Does somebody know how I can do this? Greeting, Arthur
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
RE: read external textfile
Thursday, February 15, 2007 3:40 AM
( permalink)
Try this: Set xml = Server.Createobject("Microsoft.XMLHTTP") On Error Resume Next xml.open "GET", http:// www.remotesite.com/test.txt, False If Err.Number <> 0 Then 'Could not open the file....do something here Else xml.send End If On Error Goto 0
|
|
|
|
Thuurke
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 2/14/2007
-
Status: offline
|
RE: read external textfile
Thursday, February 15, 2007 5:56 AM
( permalink)
Thank you! How simple it can be.....
|
|
|
|