Page 1 of 1
SFTPClient.DownloadFile Overwriting local file
Posted: Sat 13 Feb 2016 18:16
by jeisen
I'm using Delphi XE8 and SFTPCLient.DownLoad file works perfectly when overwrite is set to true. However, when set to false I get error 80 and the OnError event does not seem to fire. I tried to set a breakpoint in the OnError event but it doesn't work. I also tried using try except on e:EScSFTPError and it doesn't break either. I suspect it triggers the error somewhere in the DownLoad code?
I appreciate any assistance, I want to be able to allow the user to decide whether to overwrite the local file.
thank you
Re: SFTPClient.DownloadFile Overwriting local file
Posted: Mon 15 Feb 2016 10:35
by ViktorV
To snip this error, you can use the following code:
Code: Select all
try
ScSFTPClient.DownloadFile(Path, Filename, False);
except
on E: EOSError do
ShowMessage('File already exists.');
end;
Re: SFTPClient.DownloadFile Overwriting local file
Posted: Tue 16 Feb 2016 16:04
by jeisen
nope ..still does not trap the error
Re: SFTPClient.DownloadFile Overwriting local file
Posted: Wed 17 Feb 2016 14:57
by ViktorV
Please check whether the issue is reproduced on our SFTPClient demo project, that can be found in the 'Demos\SFTPClient' folder relatively to the SecureBridge demos installation path. In addition, please clarify - is the TScSFTPClient.NonBlocking proeprty set to True? If it is, then set it to False and check whether the error can be snipped.
Re: SFTPClient.DownloadFile Overwriting local file
Posted: Mon 22 Feb 2016 23:51
by jeisen
setting the nonblocking property did it..thanks
Re: SFTPClient.DownloadFile Overwriting local file
Posted: Tue 23 Feb 2016 14:38
by ViktorV
It is good to see that the problem has been solved.
If you have any questions during using our products, please don't hesitate to contact us - and we will try to help you solve them.