I need to download a file from a website using different threads and downloading different sections of the file at once, I know I can use Webclient.downloadfile method but it doesnt support downloading a file in chunks. If you could point to a tutorial or give me an idea on how to do it I would appreciate it. Thanks!
Share
To piggy back on Rex’s answer, there is no fool-proof way to know. Some web servers will provide you with a content-length or some will return -1 for length. Annoying, I know..
Your best bet is to specify a fixed range and utilize some heuristics or analysis to determine estimated length of your chunks over time.
You’ll also want to look at this similar SO question on Multipart Downloading in C#.