Page 1 of 1

HowTo Use TScSFTPClient.OnSuccess?

Posted: Wed 02 Mar 2016 21:03
by dwriedel
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.

Re: HowTo Use TScSFTPClient.OnSuccess?

Posted: Thu 03 Mar 2016 15:48
by ViktorV
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;

Re: HowTo Use TScSFTPClient.OnSuccess?

Posted: Sat 05 Mar 2016 15:39
by dwriedel
Thanks for the quick reply. It is working now.

Re: HowTo Use TScSFTPClient.OnSuccess?

Posted: Wed 09 Mar 2016 13:51
by ViktorV
It is good to see that the issue has been solved. Feel free to contact us if you have any further questions about SecureBridge.