Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have a requirement from one of my client where they want to send Contact and its related object data to there local server in CSV format. The want to establish a FTP connection so that file can be directly transferred to a fixed location on there server.

I am able to create the CSV file within APEX code, however not sure how to send out a file.

One option can be to create an multipart HTTP request and send the file as the body, however they do not have any service setup to consume the request.

Is it even possible to transfer a file directly from Salesforce to a server location without any service setup?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You can't directly access FTP in Apex Code, because FTP requires interactive sockets and multiple ports (not to mention the FTP port isn't available for call outs). You will need an intermediary to translate the request into something that can connect to the FTP server. For example, you could write a SOAP service you could call to send the file to the FTP server. Or an email client that watches a certain address. Or some REST device that can do this.

I've had a proxy like this on my bucket list, but I haven't had the time yet to build it. It should be relatively trivial though, for a competent developer in any one of the multitude of languages that this could be developed in.

share|improve this answer
Thanks @sfdcfox.. this helps!! –  Yash Mehta May 15 '14 at 19:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.