The following basic program was created in Delphi Community Edition 10.2.3 to demonstrate streaming a remote file. This is a console mode application but it could easily be turned into a GUI application of greater sophistication such as one that allows a user to specify the remote and local paths.
This basic program has been extracted from “How To Program Effectively in Delphi For AS/A Level Computer Science by Dr Kevin R Bond” which is currently under preparation. An Early Access PDF Edition will be able from the end of February 2019 .
System.SysUtils, System.Classes, idHTTP, System.Net.HttpClient;
MemoryStream1 : TMemoryStream;
Http1 : THTTPClient; // Delphi 10.2 otherwise use TidHTTP with ssl library
LocalPath : String = 'C:\Users\drbond\Downloads\';
RemotePath : String = 'https://filestore.aqa.org.uk/sample-papers-and-mark-schemes/2016/june/';
MemoryStream1 := TMemoryStream.Create;
HTTP1 := THTTPClient.Create;//(Nil) required for TidHTTP;
HTTP1.Get(RemotePath + 'AQA-75161-QP-JUN16.PDF', MemoryStream1);
MemoryStream1.SaveToFile(LocalPath + 'AQA-75161-QP-JUN16.PDF');
On E: Exception Do Writeln(E.ClassName, ': ', E.Message);
Writeln('Finished downloading - Press Return key to exit.');
Amazing product that comes with the full FireMonkey and FireUI multi-device development experience, plus a fully working IDE, basic database access, including even IBLite for mobile and it is FREE!