Get with Inet1. 
Author Message
 Get with Inet1.

Hi there !,

after reading all the articles in this news group I realize that I must be
totally crazy.

I cannot seem to get any BINARY files off my web site.

It read a test file fine. I am trying to get the version number of a program
and download an update if so available.

Get Text file:

subGetDocument " http://www.*-*-*.com/ ;,FALSE
That gets it fine. I strip off the cr/lf, now I compare with what is
installed and if the webpage is greater then I (try to ) execute the
following.

subGetDocument http://www.*-*-*.com/ ;,TRUE

and nothing happens. Any help would be appreciated.
Using VB6 SP3

sub subGetDocument (url as string, FileSave as string)

If FileSave Then
  Inet1.AccessType = icUseDefault
  Inet1.url = url & GetThisFile & " C:\TEMP\R.ZIP"
  Inet1.Execute , "GET"
Else: strSource = Inet1.OpenURL(url)
End If

Do While Inet1.StillExecuting
  DoEvents
Loop

end sub

Sub Inet1_StateChanged(ByVal State As Integer)
Stop 'Put there to see if it actually got here!!!
    Dim vtData As Variant

    Select Case State
    ' ... Other cases not shown.

    Case icResponseCompleted  ' 12
        Dim bDone As Boolean: bDone = False
        Dim tempArray() As Byte

        filesize = Inet1.GetHeader("Content-length")
        contenttype = Inet1.GetHeader("Content-type")

        Open "C:\somefile.exe" For Binary Access Write As #1

        ' Get first chunk.
        vtData = Inet1.GetChunk(1024, icByteArray)
        DoEvents

        If Len(vtData) = 0 Then
                bDone = True
        End If

        Do While Not bDone
            tempArray = vtData
            Put #1, , tempArray

            ' Get next chunk.
            vtData = Inet1.GetChunk(1024, icByteArray)
            DoEvents

            If Len(vtData) = 0 Then
                bDone = True
            End If
        Loop

        Close #1
    End Select
End Sub

--

http://www.*-*-*.com/
http://www.*-*-*.com/



Thu, 17 Oct 2002 03:00:00 GMT  
 Get with Inet1.
P.S. alot of code was omitted, but I am getting the version number into a
text box.
        Also tried many diffrent flavors of the
         Inet1.url = url & GetThisFile & " C:\TEMP\R.ZIP"
         Inet1.url = url & GetThisFile
         Inet1.url = url & "\" & GetThisFile

etc...

Richard G.


Quote:
> Hi there !,

> after reading all the articles in this news group I realize that I must be
> totally crazy.

> I cannot seem to get any BINARY files off my web site.

> It read a test file fine. I am trying to get the version number of a
program
> and download an update if so available.

> Get Text file:

> subGetDocument "http://webpage.com//files/inocula2/VERSION.TXT",FALSE
> That gets it fine. I strip off the cr/lf, now I compare with what is
> installed and if the webpage is greater then I (try to ) execute the
> following.

> subGetDocument http://webpage.com//files/inocula2/EXEUPD.ZIP",TRUE

> and nothing happens. Any help would be appreciated.
> Using VB6 SP3

> sub subGetDocument (url as string, FileSave as string)

> If FileSave Then
>   Inet1.AccessType = icUseDefault
>   Inet1.url = url & GetThisFile & " C:\TEMP\R.ZIP"
>   Inet1.Execute , "GET"
> Else: strSource = Inet1.OpenURL(url)
> End If

> Do While Inet1.StillExecuting
>   DoEvents
> Loop

> end sub

> Sub Inet1_StateChanged(ByVal State As Integer)
> Stop 'Put there to see if it actually got here!!!
>     Dim vtData As Variant

>     Select Case State
>     ' ... Other cases not shown.

>     Case icResponseCompleted  ' 12
>         Dim bDone As Boolean: bDone = False
>         Dim tempArray() As Byte

>         filesize = Inet1.GetHeader("Content-length")
>         contenttype = Inet1.GetHeader("Content-type")

>         Open "C:\somefile.exe" For Binary Access Write As #1

>         ' Get first chunk.
>         vtData = Inet1.GetChunk(1024, icByteArray)
>         DoEvents

>         If Len(vtData) = 0 Then
>                 bDone = True
>         End If

>         Do While Not bDone
>             tempArray = vtData
>             Put #1, , tempArray

>             ' Get next chunk.
>             vtData = Inet1.GetChunk(1024, icByteArray)
>             DoEvents

>             If Len(vtData) = 0 Then
>                 bDone = True
>             End If
>         Loop

>         Close #1
>     End Select
> End Sub

> --

> http://www.rgendron.com
> http://pages.infinit.net/richardg/



Thu, 17 Oct 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Inet1.OpenURL and Inet1.Password?

2. Inet1.Execute to uppercase...it gets even worse

3. On Error GoTo errHandler for (Inet1.OpenURL) not function,request time out

4. inet1

5. inet1 runtime error capturing

6. I can't use Inet1 to use the OpenURL method

7. FTP using "inet1"

8. inet1.openurl

9. vb5: Inet1.Execute and FTP (please help)

10. inet1.excecute

11. Inet1.Execute POST - Does it work

12. (Newbie) Q: Inet1.Execute strURL, "POST", strDATA,strHead

 

 
Powered by phpBB® Forum Software