I'm writing an App in VB6 that opens up an IE browser using the InternetExplorer object, then navigates to a https site, fills in the username and password fields and clicks the button to log in.
From there it navigates to a page within the site which contains a list of files (.PDF, .ZIP and .DOC files). I need an automated way to download this list of files, but I'm yet to find a way to do this. This also has to be done through an Authenticated Proxy.
I tried URLDownloadToFile, but it didn't work because I couldn't work out how to use it with authentication information (either for the website OR the Proxy). Can anyone clue me in here?
I'm trying to use the Internet Transfer Control, but I can't get that to work either.
Here's the code I'm using:
Dim FileURL As String
Dim i As Integer
Dim b() As Byte
Dim h As Integer
Form1.Inet1.protocol = icHTTPS
Form1.Inet1.UserName = Website_Username
Form1.Inet1.Password = Website_Password
Form1.Inet1.Proxy = Proxy_IP_Address
Form1.Inet1.AccessType = icNamedProxy
FileURL = "https://...filename.zip
b = Form1.Inet1.OpenURL(FileUR
h = FreeFile
Open "D:\xxxx.zip" For Binary As #h
Put #h, , b
Debug.Print Form1.Inet1.ResponseCode & " Error Info : " & Form1.Inet1.ResponseInfo
If I don't set the Proxy and AccessType properties, it downloads a html file that tells me I failed to authenticate with the proxy server (the same one I see if I put in my username or password incorrectly in my web browser when accessing the interent normally). If I do set these properties, i get the debug message: "12029 Error Info : Cannot connect". Does anyone know how to set proxy username and password values with this control? I also should be connecting to the proxy on port 8080 - anyone know how this can be done?
Or, alternately, is there another way to download files in this situation? Is it possible to use the InternetExplorer Object to do it somehow?
Thanks for any help you can offer,