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

SFTP + Powerbuilder

Former Member
0 Likes
2,061

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

Accepted Solutions (1)

Accepted Solutions (1)

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

Answers (2)

Answers (2)

Former Member
0 Likes

Not so smart but running for us and for free: Run PuTTY - PSFTP from powerbuilder as external application.

PuTTY Download Page

Former Member
0 Likes

Hi Tom;

  FWIW: I have used SocketWrench with PowerBuilder for years to support many connectivity requirements ... I believe that it supports Secure FTP as well:

https://sockettools.com/sockettools-library-edition/

HTH

Regards ... Chris

Former Member
0 Likes

Chris is correct. SocketTools has Secure options built in.

We use the ActiveX edition (ocx controls) in our PB apps (socketwrench, e-mail, dns, e-mail attachments, telnet, https submit). They work well, and the developers behind them are very responsive if you need help getting them to work.

https://sockettools.com/sockettools-activex-edition/

And the licensing is easy too. Pay for the tool once, deploy controls for free.