web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

WinSCP problem in nav

(0) ShareShare
ReportReport
Posted on by

Hey guys . When trying to upload/donwload from FTp test server to nav  and using WinSCP i get an error of type ,cant load WinSCP instances.Any suggestions ?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    Share your code. You don't need to use the WinSCP to upload/download you can connect directly to the server without additional software. I believe I have already shared code with you in other thread.

  • Community Member Profile Picture
    on at

    Yes but it was given the way they need it to be done ,thats why i need to use WinSCP. I am sharing you the code but i dont think teres problem in the code because wheni try to save codeunit it says canot load WinSCP....... the specific .Net variable.

    Heres the code :

    LEAR(WinSCPSessionOptions);

    CLEAR(WinSCPSesh);

    CLEAR(TransferOptions);

    WinSCPSessionOptions := WinSCPSessionOptions.SessionOptions;

    WinSCPSessionOptions.HostName := 'INDIRIZZO IP';      

    WinSCPSessionOptions.UserName := 'USERNAME';          

    WinSCPSessionOptions.Password := 'PASSWORD';          

    WinSCPSessionOptions.PortNumber :=21;                

    DirectorySFTP := '/DIRECTORYFTP/';                      

    Protocol := Protocol.Ftp;

    WinSCPSessionOptions.Protocol(Protocol);

    FtpSecure := FtpSecure.Explicit;

    WinSCPSessionOptions.FtpSecure(FtpSecure);

    WinSCPSessionOptions.GiveUpSecurityAndAcceptAnyTlsHostCertificate(TRUE); // acquisisce e valida in automatico l'impronta digitale (certificato) del server

    WinSCPSesh := WinSCPSesh.Session;

    WinSCPSesh.Open(WinSCPSessionOptions);

    IF WinSCPSesh.Opened THEN BEGIN

     TransferOptions := TransferOptions.TransferOptions;

     TransferOptions.TransferMode := TrasferMode.Binary;

     TransferOperationResult := WinSCPSesh.PutFiles('FILE DA INVIARE',DirectorySFTP,FALSE,TransferOptions);  

     IF TransferOperationResult.IsSuccess THEN

         MESSAGE('Upload completato')

     ELSE BEGIN

       SessionRemoteExceptionCollection := TransferOperationResult.Failures;

       FOREACH SessionRemoteException IN SessionRemoteExceptionCollection DO

         MESSAGE(SessionRemoteException.ToString);

     END;

    END ELSE

     MESSAGE(GETLASTERRORTEXT);

  • Community Member Profile Picture
    on at

    Hey Suresh , can i have the fob of your previuous example ?

  • Suggested answer
    Suresh Kulla Profile Picture
    50,269 Super User 2026 Season 1 on at

    Sorry, I don't have the fob, I have the text file if you need it.

  • Community Member Profile Picture
    on at

    Ok , but how can i ask you about some things i dont understand there , if possible ?!

  • Rashed Profile Picture
    3,765 on at

    Hello

    Make sure you have the right version.  Or re-select the variables in your designer.  WinSCP releases updates so the version installed on your computer will be different than the one running on your client.

  • Community Member Profile Picture
    on at

    Hey there can I have the text or fob file as well please. Thank you, Geovanny

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans