Results 1 to 4 of 4

Thread: I BET NONE OF YOU CAN ANSWER THIS!!!!!!

  1. #1
    Guest

    Exclamation

    Heres the question and its pretty hard. Its not hard code wise but its hard becuase you have to have great knowledge on how http protocol works.

    I have created a Winsock program that will download files from the internet. Ok nothing new right? Well it downloads any type of file including binary files. It displays the Kbps, Estimated Time Left, Etc.. All that good stuff and heres the problem I ran into. I have a resume feature so you can resume the download if its stopped. According to documentation on the web by adding a Range: protocol to the header you send the server it should send you back the file after that range. Well when I download the rest of the file i get more data than what I wanted. I mean like if the file is 1.08 mb I usually download 1.10 mb for some reason. I dont know why and I cant figure it out. To look at the code download it at:
    http://elucidsoftware.hypermart.net/winsock.zip

  2. #2
    Guest
    maybe its because you are accidently getting a few bytes that you already downloaded, which will corrupt the file and make it larger, I dont know how to fix it, but this may be the problem.

  3. #3
    Guest
    I think it is the problem but I cant really tell what the problem is becuase theres no way to really see. When I looked at the binary code in a wordpad the two codes looked similar UNTIL I hit the mark where I resumed it looked all screwed up.. I have no idea whats going on but I would appreciate anyones advice..Even if you dont know what it is I would like your views on it.

  4. #4
    Guest
    yeah, the resuming is definetly your problem,
    try to download a file and not resume it, to see if it works.
    if so than it DEFINETLY is the resuming, I dont know how to do this, but try over writing(not adding to) the last 1 or 2 kb of the file being resumed... like this

    Code:
    entire file 20kb(lines)
    --------------------
    file that was paused 8kb(lines)
    --------
    normally to resume the file you add 12 kb(lines)
    -------- + ------------
    but instead overwrite the last kb(line) of the file, and write 13kb(lines) instead of 12
    (-------- (minus) -) (plus) -------------

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