A few questions (SFTP)

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
borax1974
Posts: 12
Joined: Wed 15 Sep 2010 14:42

A few questions (SFTP)

Post by borax1974 » Tue 05 Oct 2010 12:24

Hi

I'm trying out SecureBridge, expecially SFTP.
I have a few questions

1. How can I implement an progress bar and stop functionality with sftp (nonblocking) operation.
2. How can I check if a file exists on the server (on a specific directory)

Thanks

Bora Aydemir

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

Post by Dimon » Wed 06 Oct 2010 10:28

1. You can proccess the TScSFTPClient.OnData event. And you can generate an exception when you want to abort file dowloading.

2. You can use the ReadDirectory method to retrieve a directory listing. For every received file or directory name the OnDirectoryList event is generated.
Also you can try to execute the OpenFile method with the fmOpenExisting flag. If the specified file doesn't exist, the server returns an error.

borax1974
Posts: 12
Joined: Wed 15 Sep 2010 14:42

Post by borax1974 » Wed 06 Oct 2010 15:17

The onData event isn't triggered? I tried blocking and nonblocking. Surely I'm doing something wrong but what?

I have another question about ssh shell. I want to connect to a a ssh server (like putty) and send commands like cd, unzip file, execute a batch file etc. I looked thru the SSHClient demo but couldn't manage to find a way? Can I do this with SecureBridge?

Thanks

Bora Aydemir

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

Post by Dimon » Fri 08 Oct 2010 08:01

borax1974 wrote:The onData event isn't triggered? I tried blocking and nonblocking. Surely I'm doing something wrong but what?
Note: the OnData event is arised only on reading file from SFTP server or on dowloading. To process sending data you can use the OnSuccess event.

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

Post by Dimon » Fri 08 Oct 2010 08:22

borax1974 wrote:I have another question about ssh shell. I want to connect to a a ssh server (like putty) and send commands like cd, unzip file, execute a batch file etc. I looked thru the SSHClient demo but couldn't manage to find a way? Can I do this with SecureBridge?
You can look at the example of using command line in the Shell tab of the SSHClientApp demo.

borax1974
Posts: 12
Joined: Wed 15 Sep 2010 14:42

Post by borax1974 » Wed 13 Oct 2010 11:15

Thanks for the help.

I got all ssh telnet, sftp etc working and triggered the OnSuccess event also when uploading a large file. I just need advice on the OnSuccess event. How can I determine how many bytes of the file uploaded or remaining?

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

Post by Dimon » Mon 25 Oct 2010 09:00

TScSFTPClient sends data by pieces of WriteBlockSize size. Threfore you can consider that count is equal to the WriteBlockSize property.

Post Reply