Results 1 to 3 of 3

Thread: Winsock again...:)

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Hi,

    Like I said the last time, this should go in the Internet Dev Forum, but that is dead, many more people go here and so I'm more likely to find someone who knows the answer. Ok, I'm using this to download a file from the internet...

    Dim strCommand As String
    Dim strWebPage As String

    strWebPage = "http://www.desktopdriving.co.uk/driving/version.txt"
    strCommand = "GET " + strWebPage + " HTTP/1.0" + vbCrLf
    strCommand = strCommand + "Accept: */*" + vbCrLf
    strCommand = strCommand + "Accept: text/html" + vbCrLf
    strCommand = strCommand + vbCrLf
    Winsock1.SendData strCommand

    It works fine, but now I'd like to get the size of the file before it starts downloading so I can make a progress bar.

    Any help much appreciated..

    Regards,

    ------------------
    - Chris
    chris.kilhams@btinternet.com

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,176

    Post

    In the Data Arrival Event, Check the Data Header and it should contain something like:
    Content-Length: <bytes>.
    So you could do a search for Content-Length: to get the value you're after.

    ------------------
    Aaron Young
    Analyst Programmer
    aarony@redwingsoftware.com
    adyoung@win.bright.net

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Thanks Aaron! I didn't think of that (doh!)

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