1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| var
Fs : TFileStream;
begin
Fs := TFileStream.Create('c:\logo.jpg',fmCreate);
With IdSSLIOHandlerSocketOpenSSL1 do
Begin
SSLOptions.RootCertFile := 'RootCert.cer';
SSLOptions.CertFile := 'Cert.cer';
Port := 443;
end;
with IdHTTP1 do
try
Request.Username := 'username';
Request.Password := 'pass';
try
Get('https://www.site.com/fichier_a_telecharger.jpg',Fs);
except
On e : Exception do
MessageDlg(Format('Erreur : %s',[e.Message]), mtInformation, [mbOK], 0);
end;
finally
Free;
end; |
Partager