Hi,
I am using Inet AcitveX to download a file form Http.(code below) but
couldnot able to download. The file size is about 2MB.
Please Suggest.
Thanks
Code
Private Sub Command1_Click( )
Inet1.Protocol = icHTTP
Inet1.OpenURL Http://hostname/hi.exe
Inet1.Execute , "GET Hi.exe c:\Hi.exe"
End Sub
Private Sub Inet1_StateChan ged(ByVal State As Integer)
Const lCHUNKSIZE As Long = 1024
Dim vtData As Variant ' Data variable.
Text1.Text = State 'For checking only
Select Case State
Case icError ' 11
vtData = Inet1.ResponseC ode & ":" & _
Inet1.ResponseI nfo
Case icResponseCompl eted ' 12
Dim strData As String: strData = ""
Dim bDone As Boolean: bDone = False
' Get first chunk.
vtData = Inet1.GetChunk( lCHUNKSIZE, icString)
DoEvents
Do While Not bDone
strData = strData & vtData
' Get next chunk.
vtData = Inet1.GetChunk( lCHUNKSIZE, icString)
DoEvents
If Len(vtData) = 0 Then
bDone = True
End If
Loop
Case icDisconnected
Debug.Print "* Disconnected"
Unload Me
End Select
End Sub