Page 1 of 1

RemoveDirectory - SFTP server error occurred: Failure

Posted: Mon 04 Dec 2017 12:59
by multimesut
Hi,

I cannot delete a folder full of file and folder. What should I do?

Command;
oSFTPClient.RemoveDirectory('/etc/test');

Error;
Project Project1.exe raised exception class EScSFTPError with message 'SFTP server error occurred: Failure'.

Re: RemoveDirectory - SFTP server error occurred: Failure

Posted: Thu 07 Dec 2017 10:07
by ViktorV
Most likely your SFTP server does not allow removing an empty directory. Then, to solve the issue, you should clear the directory before calling the RemoveDirectory method.

Re: RemoveDirectory - SFTP server error occurred: Failure

Posted: Thu 07 Dec 2017 17:44
by multimesut
I can not delete the full folder via winscp and I do not get any errors. but I get this error when I delete the full folder with the command RemoveDirectory in SecureBridge component. I delete everything in the folder but it deletes the empty folder. I need you to have a code like the one below.

RemoveDirectory(folder:string;allfiles:boolean)

Re: RemoveDirectory - SFTP server error occurred: Failure

Posted: Fri 08 Dec 2017 12:36
by ViktorV
The TScSFTPClient component executes SFTP protocol commands and generates an error if the server returns an error when executing a command. This is correct behavior of our component. To solve the task, you should implement this functionality by yourself.