Ive just started playing with the Webbrowser component for an application I am developing. I'm scratching my head to resolve some of my problems but the file download looks like a piece of cake.
Just add a Webbrowser component to your form and in the Form_Load try WebBrowser1.Navigate"
Use a Inet control, from the "Ms Internet Transfer Control 6.0 (SP4)" and configure it:
With Cnx_HTTP
.Protocol = icHTTP
.AccessType = icUseDefault
.URL = s_URL_to_File
End With
Cnx_HTTP.Execute , "GET"
And, finally, in the Inet's StateChanged() event, catch the response (string/file):
if State = Case icResponseCompleted
v_Tmp = Cnx_HTTP.GetChunk(1024, icByteArray)
Do While LenB(v_Tmp) > 0
v_File = v_File & v_Tmp
v_Tmp = Cnx_HTTP.GetChunk(1024, icByteArray)
Loop
'From here, call a method that saves the file.
End If
Well. That's all
I have similar code, but to retrieve text files (html,txt,etc) from web
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.