Solved

How to get the state of an Inet control?

Posted on 2004-08-21
2
495 Views
Last Modified: 2013-12-25
Hi!
 I have a program which downloads a file off the internet using an Inet control. The file is on an HTTP server and I'm not sure what to use when I want to get "text.txt" which is located under "www.site.com/text.txt

 Inet1.Execute "http://www.site.com", ??????

How can I make my program proceed AFTER the file has been downloaded? Or how can I find out if the Inet control has finished downloading the file?


Thanks in advance!
0
Comment
Question by:andy_entchev
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 125 total points
ID: 11862612
Here is an example of how to download a file using the Inet control.  Code will not continue after the Inet1.OpenURL() call until the file has been completely downloaded.

You just need to change the path and fileName variables to the values you need.

Regards,

Idle_Mind

Private Sub Command1_Click()
    Dim path As String
    Dim fileName As String
    Dim byteData() As Byte
   
    path = "http://www.plgrove.org/america/"
    fileName = "9-11.jpg"

    byteData() = Inet1.OpenURL(path & fileName, icByteArray)
    Open (App.path & "\" & fileName) For Binary Access Write As #1
    Put #1, , byteData()
    Close #1
   
    MsgBox App.path & "\" & fileName, vbInformation, "Download Complete"
End Sub
0
 

Author Comment

by:andy_entchev
ID: 11898863
Thanks alot that worked!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

758 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

22 Experts available now in Live!

Get 1:1 Help Now