1. Thierry Del Fiore
  2. PowerBuilder
  3. Wednesday, 8 November 2023 15:38 PM UTC

HI,

We need to exchange files via SFTP from PB.

FTP is working via topwizprogramming.com code, but SFTP is not supported.

We are looking to use Winscp (command line script is supported).

We would like to do it in the powerscript code.

We tried  .NET DLL importer in PB  to import the WinSCPnet.dll

the result in a couple of NVO

Tried to connect but it crashes

 

Does anybody manage to make it work ? 

Code example would be appreciated

Thanks

Miguel Leeuwe Accepted Answer Pending Moderation
  1. Thursday, 9 November 2023 21:54 PM UTC
  2. PowerBuilder
  3. # 1

In your nvo, in the of_CreateOnDemand function (if I remember the name well), do you use "LoadWithDotnet" or "LoadWithDotnetFrameWork" ?

Try the latter.

Also, bear in mind that debugging the DLL imported stuff is hard to debug, it easily crashes (at least in our place), so you could use messageboxes instead to know how far you get.

Which version of PB are you using?

Comment
There are no comments made yet.
Ronnie Po Accepted Answer Pending Moderation
  1. Thursday, 9 November 2023 18:22 PM UTC
  2. PowerBuilder
  3. # 2

You might take a look at PuTTY. I use the psftp.exe client to perform SFTP transfers from a PowerBuilder app.


https://www.puttygen.com/download-putty#PuTTY_for_windows

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 8 November 2023 16:03 PM UTC
  2. PowerBuilder
  3. # 3

Hi Thierry;

  AFAIK: Roland's code does not support SFTP.  (you need to reconfirm with Roland)

  For that requirement, you would need to switch to another 3rd party product. For example ...

Probably a few more options if you Google around - but, these are the most popular in my list.  HTH

Regards ... Chris

 

 

Comment
  1. Thierry Del Fiore
  2. Thursday, 9 November 2023 08:33 AM UTC
HI Chris,



that's correct.

that's why we want to use WinSCP.

Just wondering if anybody manage to make it work in powerscript (with .NET DLL importer ou Oleconnect() , to avoid .bat files
  1. Helpful
  1. Andreas Mykonios
  2. Thursday, 9 November 2023 09:06 AM UTC
Hi.

I had used WinSCPnet.dll but it was with PB.NET... Things where easier there. I will try to find what exactly I've done then and come back during weekend.

Andreas.
  1. Helpful 1
  1. Roland Smith
  2. Thursday, 9 November 2023 20:27 PM UTC
My FTP example uses the WinInet API which doesn't support SFTP. I thought that Winscp had a COM DLL that could be used. If a batch program is used, my RunAndWait code will help. https://www.topwizprogramming.com/freecode_runandwait.html
  1. Helpful 1
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.