-
Howdy Folks:
I am trying to download some files off the Internet, so I made a sub called DownloadFile as follows:
Code:
Sub DownloadFile(Host As String, Directory As String, File As String, OutputFile As String)
Inet1.RemoteHost = Host
While Inet1.StillExecuting = True
DoEvents
Wend
Inet1.Execute Host, "cd " & Directory
While Inet1.StillExecuting = True
DoEvents
Wend
Inet1.Execute Host, "GET " & File & " " & OutputFile
While Inet1.StillExecuting = True
DoEvents
Wend
Inet1.Execute Host, "CLOSE"
While Inet1.StillExecuting = True
DoEvents
Wend
End Sub
Now, I can't figure out why this works:
DownloadFile "ftp://weather.noaa.gov", "/data/observations/metar/stations", "KFCA.TXT", "C:\Test.txt"
...and this doesn't:
DownloadFile "http://www.flightsimnetwork.com", "/montair/ma", "page5.html", "C:\Test.html"
Any ideas? I'm stumped.
-
I know it shouldn't be an issue on Win98, but
it wouldn't have anything with the 4 character
extension on the output file Test.html
Regards
SeanR
-
Thanks for the reply. I tried:
DownloadFile "http://www.flightsimnetwork.com", "/montair/ma", "page5.html", "C:\Test.txt"
...and:
DownloadFile "http://www.flightsimnetwork.com", "/montair/ma", "page5.html", "C:\Test.htm"
...it still doesn't download. I watch the computers down in the system tray, and they flash as if something is going on, but nothing happens. I also just tried "c:\test.txt" and that doesn't work, either.
Any more ideas?
-
I got it working. Here is my code:
Code:
Open "C:\Test.htm" For Output As #1
sstr = Inet1.OpenURL("http://www.flightsimnetwork.com/montair/ma/page5.html")
Print #1, , sstr
Close #1
This is all nice and everything, but why didn't the other one work?!
-
You just can't use ftp commands (like cd and get) on http.
-
I see now... Well, thanks to all of you....
Allen