cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SFTP + Powerbuilder

Former Member
0 Likes
2,062

Hi everyone,

I want to upload files on a SFTP Server.

Now i am looking for an easy way to do this. At the Moment we already use the FTP upload with a windows dll. But there is no support for SFTP.

Does anyone know a dll or something else with that we can realize a SFTP upload?

I already found some solutions for example the chilkat_9_5_0.sftp this is a activeX control. So we can use it with an OLE Control.

But I want to know if there are any other and cheaper solutions.

Best regards,

Tom

View Entire Topic
arnd_schmidt
Active Contributor
0 Likes

WinSCP is a nice tool.

Take a look at it's command line / scripting options and now also the COM options.

https://winscp.net/

https://winscp.net/eng/docs/scripting

https://winscp.net/eng/docs/library

Former Member
0 Likes

Yes. WinSCP has a COM object, and a .net library...

Works great for us... And it's free. Supports SFTP, FTP, FTP TLS/SSL Implicit, TLS Explicit and SSL Explicit.

Andreas.

Former Member
0 Likes

Thanks for the answer.

But do you know if we can use the WinSCP .NET & COM Library for our commercial software?

Tom

arnd_schmidt
Active Contributor
0 Likes

License :: WinSCP

Yes, you can.

Former Member
0 Likes

Hi,

now I want to use the WinSCP COM but I have a problem.

I get a error at the call of the Open method of the WinSCP.Session.

The error is:

Error calling external object function open at line 24 in function of_winscp of object n_cst_ftp

Can anybody help me?

This is my code:

oleobject loo_sessionOption

oleobject loo_session

loo_sessionOption = create oleobject

loo_session = create oleobject

IF  loo_sessionOption.ConnectToNewObject( "WinSCP.SessionOptions" )  < 0 THEN

     messageBox ( "Fehler", "COM connect" )

     RETURN

END IF

IF  loo_session.ConnectToNewObject( "WinSCP.Session" )  < 0 THEN

     messageBox ( "Fehler", "COM connect" )

     RETURN

END IF

loo_sessionOption.Protocol = 2

loo_sessionOption.HostName = ""

loo_sessionOption.PortNumber = ""

loo_sessionOption.UserName = ""

loo_sessionOption.Password =""

loo_session.Open ( loo_sessionOption )

destroy loo_sessionOption

destroy loo_session

Regards

Tom

Former Member
0 Likes

Maybe it is because some session options like hostname are empty?

You may get more information if you catch the OLERuntimeError exception and look for the "description" property.

For an examplelook here:

Former Member
0 Likes

Hi Tom;

  I believe that SessionOptions ( or what you refer to as loo_sessionOption ) is a custom class ...

FYI:  SessionOptions Class :: WinSCP

1) Try wrapping the OLE calls in a TRY..CATCH. I find that the thrown exception reference can contain more useful information about the OLE failure.

2) I would also recommend creating an OLE Ancestor that scripts the error events. This too can provide more useful information about an OLE issue.

HTH

Regards .. Chris