Results 1 to 5 of 5

Thread: downloading file.... only large files?

  1. #1

    Thread Starter
    Addicted Member Jakys's Avatar
    Join Date
    Dec 1999
    Location
    Norway
    Posts
    180

    downloading file.... only large files?

    i have *made* an app downloading any file from internet...
    but it wont download small files... i have downloaded zipfiles on 120k etc, but when i am downloading a simple textfile on 108 bytes, i get trouble...

    it simply wont download the hole file only half of it.... but larger files work correctly...

    anybody out there who knows whats wrong?
    (the textfile i want to download is the one which is "default" in the program)
    Attached Files Attached Files
    MSN: [email protected]

    "Enhetssirkelen løser alle problemer" - ÅJT

  2. #2
    Fanatic Member
    Join Date
    Sep 2000
    Location
    UK.
    Posts
    728

    Smile

    I just looked at your code, and it's really hard to understand whats going on where you are dealing with byte arrays in the DataArrival event.

    If you are downloading a file of length 108 bytes, this should ALL be contained in the first chunk of data recieved in the DataArrival event... So there might be a problem with your parsing algorithm

    Why not hold the data which you get in the Winsock_DataArrival event in a string? This will make it A LOT easier to parse header info. from.

    Also, you don't need to send all the header fields your sending at the moment. A header such as the following should work:
    "GET *MYURI* HTTP/1.0" & Vbcrlf & Vbcrlf
    Hope this helps
    Laterz
    Digital-X-Treme
    Contact me on MSN Messenger: [email protected]

    [VBCODE]Debug.Print Round(((1097) - ((55 ^ 5 + 311 ^ 3 - 11 ^ 3) _
    / (68 ^ 5))) ^ (1 / 7), 13)[/VBCODE]

  3. #3

    Thread Starter
    Addicted Member Jakys's Avatar
    Join Date
    Dec 1999
    Location
    Norway
    Posts
    180
    well, im not the one making the code

    but thats the only code i have found on downloading a file which actually works !

    but do you have a better code?
    MSN: [email protected]

    "Enhetssirkelen løser alle problemer" - ÅJT

  4. #4
    Hyperactive Member cajsoft's Avatar
    Join Date
    Aug 2000
    Location
    Glasgow, Scotland
    Posts
    295
    Hi,
    Try using the InternetReadFile function from the "Wininet.dll" API.

    If you need an example, let me know.

    Craig.

  5. #5
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    look at this thread:

    http://forums.vb-world.net/showthrea...ghlight=upload


    and look at my response!!

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