How To Automate An SFTP File Transfer

Automated file transfers are usually done through scripts, but we have a better solution: Learn how SFTP automation eliminates the need for custom scripts and how to schedule and manage file transfers using a no-code solution.
  1. Blog

Automated secure file transfer protocol (SFTP) file transfers are traditionally done through scripts, but there's a much easier way. In this tutorial, we'll show you how to automate SFTP file transfers without scripting a single line of code.

To accomplish this task, we'll be using JSCAPE MFT Server by Redwood, which is a managed file transfer solution that simplifies business process automation through the use of triggers. Triggers are a comprehensive suite of automation-enabling tools that can be enabled (or triggered) based on a timeframe, an object or an event. Triggers are presented in an intuitive graphical user interface so you avoid working through a command line. For a more comprehensive discussion on triggers, refer to the online documentation.

What is SFTP?

SFTP is a secure shell (SSH) protocol that allows file-sharing functionality. SFTP empowers you to safely access, transfer and manage files over any reliable data stream, like on-premises or in cloud-based systems. SFTP also contains a connector that allows you to securely transfer files between a client and a remote SFTP server or between different storage locations. SFTP encrypts the data you share so that unauthorized users can’t access it. SFTP also provides multiple authentication methods as additional security measures, such as a user ID and password, public key pairs and host authentication. Not only do SFTP servers enable you to securely share data, but they also conduct data integrity checks to ensure the data hasn’t been altered when the receiver accesses it.

The need for automation in SFTP

Automation in SFTP is important because it can streamline how you transfer data, reduce manual errors that naturally occur from humans and increase the overall efficiency of your organization’s workflow. Using SFTP helps you securely share files and provides more layers of protection against potential security risks, and automation mitigates inefficiencies of having to manually find and send large amounts of data. One of the best ways to use automation in SFTP is to set up triggers. Creating triggers will make it easy to automate your file transfer process because triggers allow you to set up specific actions when certain events occur, such as file uploads or downloads by staff or clients.

How to set up triggers in JSCAPE MFT Server

This tutorial will give you an overview of how triggers work.

Logging in to the JSCAPE MFT Server administrative web interface, navigate to the Triggers module. For this example, we will create a trigger that would listen to a specific file movement in the machine's local file system. Once it detects that specific file movement, it will respond by uploading that same file to a remote SSH FTP service.

Before creating that trigger, however, let’s look at the trigger responsible for moving the file.

automate sftp transfer

Looking at this trigger's action parameters, the file name to be moved is “azureblobdownloadfile.txt”, and it will be moved from “E:\downloads” to “D:\testuserfiles.” The trigger we're about to create should only respond to a file movement that involves this particular file and these source/destination directories.

automate sftp transfer - 2

Let's create the trigger now. To create the trigger, just go to the Triggers module and click the Add button.

automate sftp transfer - 3

Give this trigger a name, such as “automate sftp transfer of moved file.” After that, select the “File Move” event type. This is the type of event this trigger is supposed to respond to, given our example. Now, let us schedule the trigger to run on a defined schedule.

How to copy files from Azure Blob Storage to AWS S3

automate sftp transfer - 5

In a production environment, there would be several file movements, and we want this trigger to respond only to a specific file movement. To do so, we need to specify a set of trigger conditions.

Let’s build a trigger condition that will allow this trigger to respond only to those “File Move” events where:

  • The source file is “E:\downloads\azureblobdownloadfile.txt”, and
  • The destination file is “D:\testuserfiles\azureblobdownloadfile.txt”

Recommended reading: Introducing the new trigger conditions expression builder

Click Next once you're done building the trigger condition.

automate sftp transfer - 6

In the next screen, click the Add button and then select “SFTP File Upload” from the action dropdown list.

automate sftp transfer - 7

In the action parameters dialog, start by specifying the hostname or IP address of the remote SFTP server where you want to upload the file in question.

automate sftp transfer - 8

Next, enter the login credentials of a valid user account on that remote SFTP server.

Then, specify the file path of the file you wish to upload. Because we used the “File Move” event type in this trigger, we can use the %DestinationFile% variable for this purpose. This variable already holds the complete file path of the file after it was moved to the local destination directory.

Lastly, specify the target directory in the remote SFTP server. We just want this file to be uploaded to the user account's root directory, so let’s enter the forward slash (/) here.

automate sftp transfer - 9

Click OK and then drag an arrow from the Start output of the Workflow node to the Trading Partner Synchronization Action node.

Recommended read: Introducing the redesigned trigger action workflow

Click OK to finalize the trigger creation process.

automate sftp transfer - 10

automate sftp transfer - 11

And that’s it! Now you can configure your secure FTP server so that you can automate an SFTP transfer.

SFTP automation use cases

SFTP automation can benefit organizations across a variety of industries. You can improve how your business shares data, and automated file transfer will make it easy to transfer large files in a secure and efficient manner. If you have more complex workflows, your organization can use scripting language to set up specific rules and actions. Healthcare, financial services, government agencies and professional services are just a few examples of industries that can benefit from using SFTP automation in their daily operations.

SFTP automation for healthcare

As a healthcare provider, your business needs robust data security to comply with regulations like the Health Insurance Portability and Accountability Act (HIPAA). Using SFTP automation can help your practice streamline its file transfer process and ensure that patients’ sensitive data remains secure. Your practice can use SFTP to:

  • Transfer patients’ records, such as medical histories and diagnostic images between healthcare facilities
  • Schedule file transfers across systems and departments
  • Control who accesses different files by configuring strict permissions
  • Send and receive patients’ lab results from other facilities

When your healthcare facility uses a comprehensive MFT solution to automate its file transfer process, you can also receive notifications for failed file transfers, which is important for troubleshooting any error handling that occurs.

SFTP automation for financial services

Financial service organizations are responsible for securely processing and maintaining massive volumes of data that typically contain sensitive information, such as bank account details, card numbers and social security numbers. The challenge is sharing this data in a safe way that protects its details from unauthorized parties. Using SFTP automation not only makes it faster to share this data, but it’s also more secure. SFTP offers an additional level of security because the server contains strong authentication measures, like public key authentication using SSH, so your organization can ensure that only authorized employees can access the data transfers. If your organization is in the financial services sector, you can use SFTP automation to:

  • Schedule file transfers of daily transactions to a remote SFTP server
  • Use an API to integrate your other apps with a solution, like JSCAPE MFT Server
  • Transfer batch files or new files related to trading stocks
  • Share CSV files that contain historical financial records

Ultimately, using SFTP automation can make it easier for your business to handle large volumes of data safely with scalability and reliability.

SFTP automation for government

Security is paramount when handling national and international files. Government agencies deal with highly classified information and strict data security standards. Your agency can use an MFT solution to safely manage various file formats, like XML, and integrate the solution with your existing operating system and tech stack. SFTP automation software, like JSCAPE MFT Server, can help your agency transfer data quickly and securely. Some ways your agency can use SFTP automation are to:

  • Configure automated tasks to transfer reports or use the command line for advanced control
  • Share files that contain confidential government information and citizens’ data
  • Share intelligence reports between federal, state and local agencies and departments
  • Send files that are encrypted and that have redacted data

Because SFTP connections have strong authentication methods, your agency can implement granular permissions to maintain the integrity of the data, so you and your team can share data without spending hours focusing on cybersecurity concerns.

SFTP automation for professional services

Lawyers, paralegals, consultants and managers are just a handful of professionals who need to securely transfer client project files, legal documents, financial records and other sensitive data between parties. Using SFTP automation to transfer these files can help improve your daily workflow and keep you on track with the tasks you must complete. Here are some ways you can use SFTP automation in your professional services role:

  • Track the status of your file transfers by enabling notifications in your MFT software
  • Use SFTP clients to provide a more secure connection for ad-hoc file sharing
  • Reduce human error when sharing reports
  • Safely transfer large project files to cloud-based systems
  • Automate data transfers ahead of time using a task scheduler

SFTP automation can help improve your organization’s file transfer process and empower your business to share data internally and externally, no matter where the receiver is located.


Get your free trial

JSCAPE MFT Server is platform-agnostic and can be installed on Microsoft Windows, Linux, Mac OS X and Solaris and can handle any file transfer protocol as well as multiple protocols from a single server. Additionally, JSCAPE MFT Server enables you to handle any file type, including batch files and XML. Download your free seven-day trial of JSCAPE MFT Server now.

Download JSCAPE MFT Server

Related Content

How to auto upload files to a server from a local directory

Install a Linux SFTP server via command line and configure via web UI

How to set up automated AS2 file transfers

How to set up an HTTPS file transfer: HTTPS file sharing