0

I'm using a combination of InternetSetFilePointer, and InternetReadFile, to support a resumable download. So when I begin downloading a file, I check to see if we already have part of it, and call InternetSetFilePointer using the size of what we have, and then I begin reading. This works ... however, here's my observation:

If I've downloaded 90% of a file, and it took 2 minutes to do so, when I resume, the first call to InternetReadFile takes approximately 2 minutes return! I can only conclude that behind the scenes, it's simply downloading the file from the beginning, throwing out everything up to the point I gave to InternetSetFilePointer, and then it returns with the "next" data.

So the questions are:

1) does WinInet "simulate" InternetSetFilePointer, or does it really give that info to the server?

2) Is there a way to make WinInet truly skip to the desired seek point, assuming the HTTP server supports doing so?

The server I'm downloading from is an Amazon S3 server, which I'm 99.9% sure supports resume.

DaveS_Lifeway
  • 375
  • 3
  • 9

1 Answers1

0

The proper way to do this finally turned up in some extended searching, and here's a link to a good article about it:

http://www.clevercomponents.com/articles/article015/resuming.asp

Basically, to do correct HTTP resuming, you need to use the "Range" HTTP header, such that the server can correctly portion the resource for your requests.

DaveS_Lifeway
  • 375
  • 3
  • 9