Newsgroups : Microsoft : microsoft.public.inetsdk.programming.wininet : 2006 Oct : Restarting a download with InternetSetFilePointer?

www.cryer.info
Managed Newsgroup Archive

Restarting a download with InternetSetFilePointer?

Subject:Restarting a download with InternetSetFilePointer?
Posted by:"Cameron Fitzhugh" (spamforall@spam.com)
Date:Fri, 13 Oct 2006 19:38:24

I have a large download so I wanted to download it in pieces.  After
InternetOpenUrl on an FTP site (ftp://ftp.xxx.xxx/...) I tried to restart
downloading where my last session ended, but InternetSetFilePointer gave a
return code of -1, and then GetLastError returned 0 (zero).  A subsequent
InternetReadFile begins at the beginning of the remote file.

Am I using the wrong method to restart a download?  There's lots of
shareware out there that says it can restart downloads, so presumably it is
possible.

I tried this same program on an HTTP site, again InternetSetFilePointer gave
a return code of -1, but in this case, GetLastError returned 12016,
ERROR_INTERNET_INVALID_OPERATION.

So, can you help me with restarting downloads in a C++ program?  I'm on XP,
up to date with all high-priority updates.

Thanks,
   Cameron

Replies:

www.cryer.info
Managed Newsgroup Archive