By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,302 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,302 IT Pros & Developers. It's quick & easy.

File Download/Resume

P: n/a
How do I download a file & resume from where it left off at a later time/date?

Any ideas?
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 2005-03-01, Crouchie1998 <Cr**********@discussions.microsoft.com> wrote:
How do I download a file & resume from where it left off at a later time/date?

Any ideas?


What protocol are you using to download the file? Both http and ftp are
capable of resuming downloads - or is this a custom protocol? The
answers to these questions will help you get a proper answer...

--
Tom Shelton [MVP]
Nov 21 '05 #2

P: n/a
I am using http (System.Net.HttpWebRequest) to download the file
Nov 21 '05 #3

P: n/a
In article <3A**********************************@microsoft.co m>, Crouchie1998 wrote:
I am using http (System.Net.HttpWebRequest) to download the file


Ok... You'll want to use the HttpWebRequest.AddRange method before you
try and resume the download... You'll look at how many bytes your
recieved and want to start at the next byte. So say you got 50 bytes of
a 100 byte file... you would call:

' - indicates from this position to end of data
myWebRequest.AddRange (-51)

Does that make sense? You are basically setting the HTTP Range header.

--
Tom Shelton [MVP]
Nov 21 '05 #4

P: n/a
OK. Thanks, but I need to keep the file as a byte array & then open it from
the next byte I think. How do I do about doing all this (code sample please)?

"Tom Shelton" wrote:
In article <3A**********************************@microsoft.co m>, Crouchie1998 wrote:
I am using http (System.Net.HttpWebRequest) to download the file


Ok... You'll want to use the HttpWebRequest.AddRange method before you
try and resume the download... You'll look at how many bytes your
recieved and want to start at the next byte. So say you got 50 bytes of
a 100 byte file... you would call:

' - indicates from this position to end of data
myWebRequest.AddRange (-51)

Does that make sense? You are basically setting the HTTP Range header.

--
Tom Shelton [MVP]

Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.