Hi secureus,
Thanks for the post.
If you already have the file created, you could use SFXCL (the command-line component of SecureFX). Here is a tip on how to use SFXCL:
http://www.vandyke.com/support/tips/sfxcl_auto.html
Based on your code snippet, however, it looks like you are looking for an SFTP API that you can incorporate into a program. If this is the case you may want to consider downloading ClientPack for evaluation. It includes a COM object called VRALib that has an API that can be used to establish an SSH2/SFTP connection and transfer files. You can download the evaluation from the following location:
http://www.vandyke.com/download/clie.../download.html
It is important to note that VRALib is only available in ClientPack for Windows.
Does this help to answer your question?