Salesforce provides various ways to import data from external systems. In addition to using various services, we can also rely on third-party services or create our own custom solution for data retrieval.

However, importing data from a remote FTP server can be challenging because Salesforce does not support an FTP server to be set as an endpoint in Remote Site Setting so we have to use an external service in this case.

To overcome this challenge, there are multiple options available to us.

  • One way is to use a third-party service that provides FTP functionality.
  • Another way is to develop a custom solution using FTP API. This allows us to establish a secure connection between Salesforce and the remote FTP server, and transfer data in a structured manner.

    In this article, we will focus on providing a step-by-step guide on how to use FTP API to import data from a remote server.

By the end of this guide, you should have a clear understanding of how to use FTP API to import data and be able to apply this knowledge to your own projects. Lets’s begin!

Pre-Requisites for Implementing this solution

Here are the things you will need to setup:

  • An FTP hosting service to create an FTP server from which you can connect and upload/download your files.

In this demo, we are using Infinity Free hosting service.

1 138776bb8b

In this, we have to just create an account and host an FTP service

  • Now when you have an FTP service you have to interact with your server. For that, you have to use an FTP client. In this case, we will be using FileZilla as our FTP client.

You can download the FileZilla FTP client from here download link. After downloading the FileZilla client you can connect with your server easily from here.

2 1 138786de6d

Put the details you got from the Infinity Free FTP details page.

After connecting your FileZilla Client will show your FTP details and its files. From where you upload files to your server.

After doing this setup you can start building your LWC app in which you can get data and then insert that data into your Salesforce org.

We are using the FTP-API download file service so for that we have configured these parameters.

3 13882952f5

Building LWC APP

Now Coming to LWC App. We will be implementing the solution we come up with using FTP API.

In this case, we are getting a CSV file from our FTP server and inserting it into the Account object.

Apex callout to download files with API.

JavaScript :

HTML :

Apex class to insert accounts:

js-meta.xml

You can use this code with your FTP username and password and deploy it to see an LWC component like this:

4 13883f170b

The Upload Files is a lightning input that is set to take a CSV from local storage.

In the lower section, the user can enter the file name which has to be downloaded from the FTP server. After getting data from the CSV it will be displayed in a data table like:

6 1 1388462241

After verifying the data user can press “Confirm Upload” to finally insert records in your Account object.

Conclusion:

In conclusion, FTP API can be a useful tool to import data from a remote server to Salesforce. With the proper setup and configuration, it allows for a secure and structured transfer of data.

By following the steps outlined in this guide, you should be able to use FTP API to import data from your own FTP server and apply this knowledge to your own projects.

Be sure to try out the solution and share your experiences with our development team at HIC Global Solutions. Happy Coding!

Related Articles
Step-by-Step Guide to Enhance Your LWC Development Workflow with the Logger API

Are you looking to streamline your LWC development workflow but confused about how to do it? Then you are in the right place. The Salesforce Logger API is a powerful tool that helps you monitor, debug, and improve code quality in real time.  This step-by-step guide walks you through how to set it up and […]

Read More
Enhancing Your Salesforce Experience with a Custom Activity Component

In today’s fast-paced business landscape, productivity hinges on streamlined workflows and intuitive interfaces. While Salesforce offers robust activity tracking capabilities, sometimes the standard components fall short of specific organizational needs.  That’s where a Custom Activity Component comes in—designed to tailor your activity management experience, boost user efficiency, and provide deeper insights into customer interactions. In […]

Read More
Step-by-Step Guide to Integrating Salesforce Doc-Gen with eSigning Tools

In today’s fast-paced digital landscape, streamlining document workflows is no longer a luxury—it’s a necessity.  Integrating a document generation app, like Docs Made Easy, with an eSigning tool, helps businesses automate the entire document lifecycle—from creation to signature—saving time, reducing errors, and boosting productivity. In this guide, we’ll walk you through the key steps, tools, […]

Read More
How to Build a Real Time Chat Application Using LWC and Models API

The Models API plays a significant role in providing access to and facilitating interaction with large language models (LLMs) from various Salesforce partners such as Anthropic, Google, and OpenAI. It enables applications to leverage these models for various tasks, including text generation and other AI-powered capabilities. As a user, you can configure any Salesforce-enabled model […]

Read More
How to Integrate Salesforce Data Cloud with Amazon Redshift

Companies can finally connect Amazon Redshift to Salesforce Data Cloud without using the ordinary username & password authentication systems ever since its collaboration with AWS has happened. Business owners no longer have to be concerned about managing static credentials or breaching data security. By leveraging Salesforce IDP, companies can easily access their data lakehouse in […]

Read More
Trigger Prompt Templates Using Flow, Apex, or REST API

A prompt template is a pre-designed structure in Salesforce, specially designed to create personalized prompts by filling the substitute with particular details of customers, products, and more. This approach strengthens the creation of prompts and lets teams generate data-driven content. Every time a prompt template is used, it automatically merges the data to create a […]

Read More
Our Location worldwide
Indian Flag India
3rd Floor, A-10, Pegasus Tower, Sector 68, Noida, Uttar Pradesh 201301 +91-1203117884
United States of America Flag USA
333 West Brown Deer Road Unit G – 366 Milwaukee WI, USA 53217 +1(262) 310-7818
United Kingdom Flag UK
7 Bell Yard, London, WC2A 2JR +44 20 3239 9428
Canada Canada
HIC Global Solutions INC
43 Lafferty Lane, Richmond Hill, L4C 3N8, CA +1(262) 310-7818