Page 1 of 1

A few questions (SFTP)

Posted: Tue 05 Oct 2010 12:24
by borax1974
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

Posted: Wed 06 Oct 2010 10:28
by Dimon
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.

Posted: Wed 06 Oct 2010 15:17
by borax1974
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

Posted: Fri 08 Oct 2010 08:01
by Dimon
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.

Posted: Fri 08 Oct 2010 08:22
by Dimon
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.

Posted: Wed 13 Oct 2010 11:15
by borax1974
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?

Posted: Mon 25 Oct 2010 09:00
by Dimon
TScSFTPClient sends data by pieces of WriteBlockSize size. Threfore you can consider that count is equal to the WriteBlockSize property.