I need to download a file that could be potentially quite large (300MB) that will later be saved locally. I don't want to read the remote file in one go to prevent excessive memory usage and intend to read the remote file in small chunks.
Is there an optimum size for these chunks?
It depends on what type of connection do you expect to use. I think, 64 Kb could be just enough.
Downloading a file in chunks -- is there an optimal sized chunk?