Assuming you are using HTTP for download, you will want to use the HEAD http verb and RANGE http headers.
HEAD will give you the file size (if available), and then RANGE allows you to load a range of bytes.
Once you have the file size, split it into pieces of the same size and find the download stream for each fragment. Once done, write the file fragments in the correct order.
EDIT:
If you do not know how to use the RANGE header, here is another SO answer that explains how:
gcochard
source share