Using Delphi Community Edition

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 .

Program Chapter30Prog5;
  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 = '';
    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.');

Delphi Community Edition 10.2.3

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!