var
Url, FileName: WideString;
begin
Url := 'https://example.com/file.zip';
FileName := 'C:\Downloads\file.zip';
DownloadFile(Url, FileName,
function(const Url, LocalFileName: WideString;
const ProgressCurrent, ProgressMax, SpeedKBps: Int64): Boolean
begin
// Обновляем прогрессбар и текст
ProgressBar.Value := ProgressCurrent;
ProgressText.Text := Format('%d%% (%d KB/s)', [ProgressCurrent * 100 div ProgressMax, SpeedKBps]);
Result := False; // вернуть True, чтобы остановить загрузку
end);
end;