My question is how I can intergrate Salesforce with different FTP servers in real time. I have read some articles about it, but to be absolutely sure I thought it would be a good idea to post a question here.

I want to be able to send and receive data from Salesforce as a csv file to a ftp server. How I'm thinking about doing this is listed below.

Send the data:

Create a apex class which query the necessary data in Salesforce and create a csv file. I guess this is trivial? Then send the file to a web service created in Salesforce, just by calling it in the apex code. Create a web service in Salesforce which receives the data from the apex code. This web service should in some way send the data to the appropriate ftp server. I guess I can simply modify some of the code provided by Salesforce to make this work? The file is sent. Receive the data

This one is a bit trickier. I guess I have to pull the data from the FTP server by using my web service, which then send the file collected to the appropriate apex class. Or, the FTP server could send the data to the SFDC web service, I don't know if this is possible? The web services on the other side that sends the data to the ftp server, could send it directly to the SFDC web service, which then again forward it to the apex class. I guess the web service will use the remote site url to connect to the SFDC web service?

  • Do you want to migrate data from one SFDC org to another?
    – Mahmood
    Commented Dec 2, 2014 at 11:47
  • Have you tried to do it with Jitterbit Data Loader? Commented Dec 2, 2014 at 12:01
  • Yes, later on I want to migrate data from one SFDC org to another, but not for this topic @MahmoodButt. Our client do not want to use Jitterbit Data Loader because they find it expensive.
    – ttveten
    Commented Dec 2, 2014 at 12:04

2 Answers 2


Through the salesforce service (Apex or others) you cannot directly communicate with an FTP server (either upload or download).

Your best bet would be to use an external application. Jitterbit Data Loader is the go to application for FTP interactions with salesforce.

You could also create your own service outside of the salesforce platform.

  • 2
    Using Jitterbit you can query the data source, extract that to a file on a schedule and use command line to zip it up and upload it to a SFTP site. It is a lot easier than trying to set up the Salesforce.com Dataloader to work via Command Line.
    – Eric Clay
    Commented Dec 3, 2015 at 20:43
  • How can I create a webservice outside Salesforce to achieve it. In our usecase, we don't have the budget to use any third-party tool like Jitterbit, so I have to achieve it via code only.
    – Student
    Commented Sep 11, 2019 at 23:39

We have implemented a REST API which allow to directly communicate with an FTP server. This FTP API is designed for people who need to perform actions like DOWNLOAD, UPLOAD, DELETE and TRANSFER on the FTP server using REST API’s.

Here we are addng API documentation and blog post link.

FTP API: https://ftp-api.herokuapp.com/

Blog Post: https://medium.com/@adarshsharma.jaipur/how-to-use-ftp-server-using-rest-api-8d1b3f88de0

  • Hi Adarsh, your api returns System.HttpResponse[Status=Service Unavailable, StatusCode=503] for any call other than Authentication
    – umithuckan
    Commented Feb 12, 2021 at 20:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .