Transferring files over FTP & SFTP protocol

This post is about transferring the file over FTP (File Transfer Protocol) & SFTP (Secured File Transfer Protocol) from Navision using WinSCP dot net library. Files can be uploaded to & downloaded from remote system.

Below is the design that i have implemented in one of our projects.

  1. FTP Setup – to configure the connection details.
  2. FTP Setup Line – to configure the methods like upload, download and file paths.
  3. FTP Log

FTP Setups:


FTP Setup:

You can create multiple FTP Setup for different connections.

  1. Active field can be used to Activate / Deactivate the FTP Setup.
  2. Sequence field can be used to setup the sequence in which the FTP batch job can process the FTP Setup.
  3. Connection can be tested using Test Connection.


FTP Setup Line:

  1. Active field can be used to Activate / Deactivate individual FTP Setup Line.
  2. Line level Sequence field can be used to setup the sequence in which Setup Line can be processed.
  3. Uploaded files can be archived & deleted using the “Archive & Delete” option.


Batch Job for Processing the FTP Setup.

Connection is only opened once for each & every Active FTP Setup and only Active Lines are processed based on the sequence defined in the setup.


FTP Logs are created when processing the the FTP Setup . Log contains the details about the files that are Uploaded & Downloaded, connection & transfer related error’s .


Batch job can be scheduled in Job Queue:


Sample code can be found from  WinSCP

WinSCP Library can be downloaded from here  and the files should be copied to the Add-ins folder.

SFTP can be tested with Rebex Tiny SFT Server .

Please do let me know your suggestion on the design and share this post. Thanks


5 thoughts on “Transferring files over FTP & SFTP protocol

  1. Hi Divesh, Your Implementation is good.This is what we are looking for.

    Please share the objects if possible ,it would be very helpful for NAV team in saving time.


  2. Hi,
    the implemantation looks quit well but without the code from the FTPManagement called from the report this is only the concept and not the solution. Can you please share your code from the expected codeunit.



Leave a Reply

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

You are commenting using your 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