Results 1 to 2 of 2

Thread: Winsock Probs.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    31
    Hey all, i'm using the Winsock API to download a zip file from my website that's roughly 200 Kb. Is there anyway I can create a big enough buffer string to download the data into?? Below is what i've got but it doesn't work. Any help is greatly appreciated!

    WINSOCK RECEIVING:

    Dim strBuf As String
    Dim buflen As Long

    strBuf = String(200000, 0)
    buflen = recv(intSocket, strBuf, Len(strBuf), 0)
    If buflen > -1 Then
    Open App.Path & "\File.zip" For Binary Access Write As #1
    Put #1, , Left(strBuf, buflen)
    Close 1

  2. #2
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355
    http://www.vbip.com

    they have good code for downloading with winsock
    the server doesnt send all the file in one huge chunk anyway..u have to do soemthing like

    Dim tmp as String

    ws.GetData tmp

    Totalrecdata = totalrecdata & tmp

    but theres more to it than that, u have to check that the header has ben received, and remove header from totalrecdata, or u end up with that in the file...
    buzzwords are the language of fools

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width