|
-
Oct 6th, 2000, 09:20 AM
#1
Thread Starter
Addicted Member
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.
- Visual Basic 6.0
- Windows XP Home
-
Oct 6th, 2000, 10:13 AM
#2
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
-
Oct 6th, 2000, 12:53 PM
#3
Thread Starter
Addicted Member
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?
- Visual Basic 6.0
- Windows XP Home
-
Oct 6th, 2000, 01:09 PM
#4
Thread Starter
Addicted Member
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?!
- Visual Basic 6.0
- Windows XP Home
-
Oct 6th, 2000, 01:43 PM
#5
You just can't use ftp commands (like cd and get) on http.
-
Oct 6th, 2000, 04:46 PM
#6
Thread Starter
Addicted Member
I see now... Well, thanks to all of you....
Allen
- Visual Basic 6.0
- Windows XP Home
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|