Results 1 to 6 of 6

Thread: A Strange Problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    At my computer
    Posts
    187
    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

  2. #2
    Guest
    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

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    At my computer
    Posts
    187
    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

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    At my computer
    Posts
    187

    Cool

    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

  5. #5
    old fart Frans C's Avatar
    Join Date
    Oct 1999
    Location
    the Netherlands
    Posts
    2,926
    You just can't use ftp commands (like cd and get) on http.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    At my computer
    Posts
    187
    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
  •  



Click Here to Expand Forum to Full Width