function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nagaraj SVNagaraj SV 

Transfer files to FTP from Salesforce Attachment object

Can any one help me how to Transfer files to FTP from Salesforce Attachment object.
You could do this with a cron script (or somthing simliar) and POST it via the REST api [1].  If you have any specific questions or problems with the implementation, please don't heasitate to ask.

Nagaraj SVNagaraj SV

Hi pcon,

Thank you for quick response . If i want to send file from Salesforce to FTP .

I have couple of questions 

1.Do we need to run any service at FTP?

2.What is the end point ?

You'll need to run something on the FTP server that will push the newly created files to Salesforce. (Something like this [1] may help you get started monitoring the FTP server *).

The endpoint would be the standard REST endpoint [2] for the Attachment object and you would just provide the fields required [3]

There are some limitations around attachments in Salesforce that you do need to be mindful of [4].  Because of those limitations you may want to consider linking to the FTP resource in a way that your users can reach (either expose it via HTTP as well or make it easy for your users to interact with FTP).  Once exposed you could create a custom Attachment object that contains the link to the resource and is linked to the appropriate object.  This way you do not use up storage space in Salesforce.

* Some FTP servers will allow you to run commands after a file is finished uploading.  That would be up to you to figure out if your FTP server will allow that.

Keith WalkerKeith Walker
You can automatically transfer your Salesforce Attachment objects to FTP (or any type of Storages) with the help of Skyvia ( It is web-based ETL service with simple UI and flexible scheduling options.
Massimiliano CiarroccaMassimiliano Ciarrocca
Hi Keith, I'm trying Skyvia. Do you know what's the name ofe the object where I can find all the attachment in SalesForce? I would like to backup all the images attached to my Service Appointmens.
You can use below FTP API to integrate FTP server with Salesforce.

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.

Blog Post:

Please let me know if you need any other information.