WinSCP .NET assembly - Issue with connection via Perl

Advertisement

unknownme
Guest

WinSCP .NET assembly - Issue with connection via Perl

Hi,

I have downloaded and registered the COM using https://winscp.net/eng/docs/library_install, the tlb file is also registered successfully on my Windows box.

I tested the WinSCP.exe with the SFTP connection and it works perfectly.

However, my requirement is to automate it through Perl. I have gone through https://winscp.net/eng/docs/library#perl and tried to test the same code (by PUTting local file on my machine to remote server which I can do it via WinSCP.exe).

I tried to use "GiveUpSecurityAndAcceptAnySshHostKey" and also later removed this key and used the actual SSH Key with "SshHostKeyFingerprint". In both the cases, I am getting NULL $transferResult (error: Can't call method "Check" on an undefined value at mytest.pl line XX.)

The code is exactly same as in example (with changes to actual file location).

Can someone point out what is missing here or what should be done in order to achieve automation via Perl?

Reply with quote

Advertisement

unknownme
Guest

Re: WinSCP .NET assembly - Issue with connection via Perl

martin wrote:

I do not do Perl. So I cannot really help you.

I'm not sure what happens, if one of the methods (.Open or .PutFiles) throws an exception.
Did you try check for that?

I've found this post: What is the best way to handle exceptions in Perl?

Hi,

Thanks for the quick response.
Yes, i tried to catch errors, while open session and others, no such errors shown. That is the reason I am surprised. I tried to catch properties of TransferOperationResult, but same issue.

If you have some across any such issues (not with Perl but other language maybe), that may help here?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,430
Location:
Prague, Czechia

Re: WinSCP .NET assembly - Issue with connection via Perl

No I didn't see such problem before.

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

You can post new topics in this forum