HowTo Use TScSFTPClient.OnSuccess?

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
dwriedel
Posts: 8
Joined: Wed 20 Jan 2016 18:46

HowTo Use TScSFTPClient.OnSuccess?

Post by dwriedel » Wed 02 Mar 2016 21:03

Dear all,
after uploading one file I want determine if the operation was succesfull or not.
How I evaluate the OnSuccess - property?
I suspect I am the wrong track... :?

Code: Select all

procedure TForm1.ScSFTPClientOnSuccess(Sender: TObject; Operation: TScSFTPOperation;
  const FileName: string; const Handle: TArray<System.Byte>;
  const Message: string);
begin
   //Operation.opWritingFile
   //https://www.devart.com/sbridge/docs/index.html?tscsftpclient_onsuccess.htm
   //??
end;

procedure TForm1.UploadFile;
begin
  ScSFTPClient := TScSFTPClient.Create(nil);
  ScSFTPClient.SSHClient := ScSSHClient;
  ScSFTPClient.NonBlocking := True;
  ScSFTPClient.Initialize;
  ScSFTPClient.UploadFile('eula.1028.txt', 'eula.1028.txt', True);
  ScSFTPClient.OnSuccess (...);
end;
I am using SecureBridge Standard, Version 6.6.9.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: HowTo Use TScSFTPClient.OnSuccess?

Post by ViktorV » Thu 03 Mar 2016 15:48

To use the OnSuccess event handler correctly, you should modify the TForm1.UploadFile method implementation in the following way:

Code: Select all

procedure TForm1.UploadFile;
begin
  ScSFTPClient := TScSFTPClient.Create(nil);
  ScSFTPClient.SSHClient := ScSSHClient;
  ScSFTPClient.NonBlocking := True;
  ScSFTPClient.OnSuccess := ScSFTPClientOnSuccess;
  ScSFTPClient.Initialize;
  ScSFTPClient.UploadFile('eula.1028.txt', 'eula.1028.txt', True);
end;

dwriedel
Posts: 8
Joined: Wed 20 Jan 2016 18:46

Re: HowTo Use TScSFTPClient.OnSuccess?

Post by dwriedel » Sat 05 Mar 2016 15:39

Thanks for the quick reply. It is working now.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: HowTo Use TScSFTPClient.OnSuccess?

Post by ViktorV » Wed 09 Mar 2016 13:51

It is good to see that the issue has been solved. Feel free to contact us if you have any further questions about SecureBridge.

Post Reply