File Upload – SFTP

 

Hey Friends,

This post I dedicated in how to upload a file on SFTP from NAV. This normally happens when we are doing some sort of processing from a file which has to be processed needs to be downloaded from a SFTP and then eventually needs to be processed. SFTP is Secured File Transfer Protocol so it’s  a level more secured then FTP.

Below is the screenshot of the code that needs to be written.

This code is to move File to respective SFTP.

WinSCP is free DLL that you can find over internet and its very effective.

CHEERS

Advertisements

17 comments on “File Upload – SFTP

  1. Pingback: File Upload – SFTP - Microsoft Dynamics NAV Community

  2. Pingback: File Upload – SFTP - Dynamics NAV by RockWithNAV - Dynamics NAV Users - DUG

  3. Hi

    Im having problems to use the WinSPC library on NAV, I can find the type and the class on declaring variables, but thows an error when try to execute saying can create an instance of .NET object WinSpcnet…

    I’ve registered

    Any ideas?

  4. Great!!!. Sorry for delayed response, Was somehow busy with Christmas and New Year Celebrations 🙂

    Let me know for any more concerns.

    • Hi Raj,

      Sorry for late reply – Was busy in Projects.
      Do you just want variables or entire code. I can share all to you.
      Here are the variables

      Name DataType Subtype Length
      WinSCPSesh DotNet WinSCP.Session.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      WinSCPSessionOptions DotNet WinSCP.SessionOptions.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      WinSCPTransferOptions DotNet WinSCP.TransferOptions.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      WinSCPTransferResults DotNet WinSCP.TransferOperationResult.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      Directory Record File
      WinSCPTransferResumeSupport DotNet WinSCP.TransferResumeSupport.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      WinSCPTransferResumeSupportState DotNet WinSCP.TransferResumeSupportState.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      MoveFileDotNet DotNet System.IO.File.’mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′
      WinSCPProtocol DotNet WinSCP.Protocol.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      WinSCPFtpSecure DotNet WinSCP.FtpSecure.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      WinSCPRemoteInfoColl DotNet WinSCP.RemoteDirectoryInfo.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      WinSCPRemoteInfo DotNet WinSCP.RemoteFileInfo.’WinSCPnet, Version=1.3.7.7601, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf’
      FileManagement Codeunit File Management
      DirectoryCheck DotNet System.IO.Directory.’mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

      • Hello,

        Can you please share me information about the TEXT001.

        Because I am getting error while Authentication failed (WinSCPSesh.ExecutablePath) at this point.

    • Hi Ami,

      Sorry for late reply was bit busy on my Projects – Host key you will get from the SFTP connection.
      You still facing OR is that sorted?

    • Hi Llyod,

      Sorry for late reply was bit busy on my Projects – This code will do for all files available. Are you facing any Issue??
      This will execute for multiple files!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s