SFTP upload/download exception question

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
snorkel
Posts: 384
Joined: Tue 08 Aug 2006 15:10
Location: Milwaukee WI USA

SFTP upload/download exception question

Post by snorkel » Tue 11 Dec 2012 19:50

Hi,
When I am doing a upload or download and I have the overwrite option set to false
How can I detect in the try except that it was related to the file overwrite and
not some other error like the connection failed?
I want to timestamp the file if it exists

Code: Select all

try
FSFTP.UploadFile(sourcefile,destfile,false);
except
    on e:EScSFTPError do 
       showmessage(e.error);
end;

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: SFTP upload/download exception question

Post by Dimon » Tue 05 Feb 2013 13:18

The point is that different SFTP servers return different errors, which also depend on a situation. Therefore, in your case, you need to handle the TScSFTPClient.OnError event. Check that the Operation parameter is equal to opOpeningFile in this event handler and process the error message.

Post Reply