SFTPСlient - abort download/upload a large file

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
alexer2
Posts: 3
Joined: Wed 18 Jul 2018 14:52

SFTPСlient - abort download/upload a large file

Post by alexer2 » Wed 18 Jul 2018 15:25

How to make a correct abort download-upload a large file in SFTPСlient?
Do this in the onData event? can you give the code?

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

Re: SFTPСlient - abort download/upload a large file

Post by ViktorV » Thu 19 Jul 2018 11:34

SecureBridge does not allow you to cancel the operation of downloading/loading a file.
If you want us to add this functionality, please write about it at our User Voice forum: https://devart.uservoice.com/forums/174370-securebridge. If your suggestion gets enough votes, we will consider the possibility of its implementation.

alexer2
Posts: 3
Joined: Wed 18 Jul 2018 14:52

Re: SFTPСlient - abort download/upload a large file

Post by alexer2 » Thu 19 Jul 2018 13:34

This is a failure. This is the basic function in file operations....

alexer2
Posts: 3
Joined: Wed 18 Jul 2018 14:52

Re: SFTPСlient - abort download/upload a large file

Post by alexer2 » Thu 19 Jul 2018 17:05

I found this solution
viewtopic.php?t=19149
it seems to work.

Code: Select all

procedure TSFTPClientFrame.ScSFTPClientSuccess(Sender: TObject;
  Operation: TScSFTPOperation; const FileName: string;
  const Handle: TArray<System.Byte>; const Message: string);
begin
  if IfNeedAbort then
    raise Exception.Create('Custom break file operation');
end;
Is this the right solution to my question?

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

Re: SFTPСlient - abort download/upload a large file

Post by ViktorV » Fri 20 Jul 2018 08:43

You can use this code to solve the task.

stlcours
Posts: 33
Joined: Wed 14 Sep 2011 20:22

Re: SFTPСlient - abort download/upload a large file

Post by stlcours » Thu 26 Jul 2018 20:05

Yes, please add a function/property to abort upload/download. It is very necessary and not a big work, so I don't think it need a separate vote for this functionality. Thanks.

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

Re: SFTPСlient - abort download/upload a large file

Post by ViktorV » Tue 11 Sep 2018 14:34

If we add a parameter to the event handler, this will change the standard behavior of this component, which has been used by our users for many years and this will affect all of them. Therefore, we asked you to write about it at https://devart.uservoice.com/forums/174370-securebridge. If your suggestion gets enough votes, we will consider the possibility of its implementation.

stlcours
Posts: 33
Joined: Wed 14 Sep 2011 20:22

Re: SFTPСlient - abort download/upload a large file

Post by stlcours » Wed 24 Feb 2021 20:42

Could you add a new event to realize this function? So it will not change the old versions, but it is really very useful.

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

Re: SFTPСlient - abort download/upload a large file

Post by ViktorV » Fri 26 Feb 2021 13:39

We'll try to add it in the next version of SecureBridge.

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

Re: SFTPСlient - abort download/upload a large file

Post by ViktorV » Mon 29 Mar 2021 09:39

We have added this functionality. This dobavleniet enter the new build SecureBridge, which we plan to release this week.
Now, to solve your issue, you can use the TScSFTPClient.BeforeReadData and TScSFTPClient.BeforeWriteDataEx event handlers.

Post Reply