SFTP

I am trying to write an automated Windows app that connects to one of my servers via SFTP, checks to see if two file exists and then downloads them, checks to see if a folder exists, if not then it will create the folder and will then move the two files to the folder (overwriting if they already exist).

I know I could do all of this using the TCP sockets but I was wondering if anyone had developed a plugin or set of classes that can be bought or free that does all the magic for me an just allows me to call method etc to do what I need?

If your app is Windows OS only you might look at the Chilkat components. I purchased them several years ago and use them quite often with Xojo and VS.net.

http://www.chilkatsoft.com/ssh-features.asp

Your might also check out the MBS plugins for a solution.

I use the MBS CURL Plugin… works on all 3 platforms…

I used these components many years ago on another project. I have downloaded and install into Xojo but cannot find any docs on how to use the controls. Do you know where I can find the docs?

I have had a look at he docs and have to say I am totally confused as to how to get SFTP to work etc. Maybe it is just me not understanding how it works.

Look in the MBS download /Examples/CURL folder… there are 3 example SFTP projects inside.

Can CURL create directories and such?

Here’s a link to the Chilkat SFTP documentation:
http://www.chilkatsoft.com/refdoc/xChilkatSftpRef.html

Here’s a link to some example code provided by Chilkat:
http://www.example-code.com/vb/sftp.asp

I’ve not used the SFTP component in a while with Xojo but you should be able to click on “Insert->Acitvex Component” on the main menu and simply drag the ChilkatSFTP component to a window. This should give you a good start if you decide to use this component. I use their components for SSH Tunneling my database connections.

Be sure to install the 32 bit version as I don’t think the 64 bit version will work with Xojo.

CURL can do a lot including SFTP.
With the quote options you can send raw commands like for creating a directory.

Hey Johnny, I did try that but when you come to run it says the controls needs to have a constructor() to be placed on the window. Do you know of any way to fix this or am I going to have to create it in code and then use the AddHandler to add the events?

Hi Nathan, Once you add the activex control to your project you should be able to drag the component to the window.

The IDE should provide autocomplete once it’s been added to the window. I threw together some code to create a directory on my server and it completed with no errors.

Ah, ok I had followed the install notes which say to add it as a reference which is why it wasnt working. Now I have added the control itself it works great. Thanks for your help.

Great… Good luck.

https://github.com/charonn0/RB-FTP

Thanks Matthew, but that is FTP rather than SFTP (FTP via SSH) but still useful for another project :wink: