Recent

Author Topic: Download the file from GITHUB  (Read 1086 times)

mpknap

  • Full Member
  • ***
  • Posts: 155
Download the file from GITHUB
« on: February 13, 2019, 07:00:17 am »
How to download a file from GITHUB using Synapse? I want to put TXT files there that would download my program.
Functions with touturial do not work.
Code: Pascal  [Select][+][-]
  1. function DownloadHTTP1(URL, TargetFile: string): Boolean;
  2. var
  3.   HTTPGetResult: Boolean;
  4.   HTTPSender: THTTPSend;
  5. begin
  6.   Result := False;
  7.   HTTPSender := THTTPSend.Create;
  8.   try
  9.     HTTPGetResult := HTTPSender.HTTPMethod('GET', URL);
  10.     if (HTTPSender.ResultCode >= 100) and (HTTPSender.ResultCode<=299) then begin
  11.       HTTPSender.Document.SaveToFile(TargetFile);
  12.       Result := True;
  13.     end;
  14.   finally
  15.     HTTPSender.Free;
  16.   end;
  17. end;            
Is this a Github lock?

 

TinyPortal © 2005-2018