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
Beginners Guide to Making Your LWC Component Multilingual

If you’re wondering how to make your LWC component multilingual, you’re already ahead of the curve. Global users expect content in their native language, and Salesforce gives you the tools to deliver exactly that. With Custom Labels and the Translation Workbench, you can easily localize your Lightning Web Components without touching a single line of […]

Read More
Hands-On Guide Building a Drag-and-Drop Form Builder Using Lightning Web Components

Drag-and-drop interfaces are a user experience staple, and when paired with the power of Lightning Web Components (LWC), they unlock dynamic, highly interactive Salesforce components. In this blog post, we’ll walk you through how to build a custom drag-and-drop form builder in LWC. Users can drag form fields like text inputs and dropdowns into a […]

Read More
Please Make Blog Banner How to Create an Agentforce Enabled Scratch Org in Salesforce 100 1

Setting up an Agentforce-enabled scratch org is the most important step for developers who want to experiment with AI features such as Prompt Builder and Einstein GPT. Whether you’re developing the next generation CRM software or experimenting with how generative AI may improve user experience, a scratch org equipped with Agentforce is your playground. Follow […]

Read More
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
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