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
sathish r 30sathish r 30 

How to get CSV file from SFTP and upload it into Salesforce Document object

Hi All,
I have a CSV file inside SFTP, and i need to get this file and move it to Salesforce document object. This needs to be automated and run every week. I cannot go for a paid tool. can any one help me with this requirment.

Thanks
 
SwethaSwetha (Salesforce Developers) 
HI Satish,
You can use Apex dataloader over CLI, install the apex dataloader on any windows machine and then put the data file path from that SFTP server. Then windows batch file will call the dataloader over CLI and finally use windows scheduler to schedule the batch file.

You can Prepare a CSV and perform an Insert to the ContentVersion object.
See https://help.salesforce.com/articleView?id=000314772&language=en_US&type=1&mode=1 for more info.

Related: https://salesforce.stackexchange.com/questions/255645/upload-file-and-attach-it-to-contentdocument
 
Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
sathish r 30sathish r 30
Hi Swetha,
Thanks for providing the input.
Could you provide me any links / reference materials for fetching CSV file from FTP/SFTP and uploading to Salesforce using Data loader CLI

Thanks
SwethaSwetha (Salesforce Developers) 
HI Satish,
These links do not provide exact implementation steps but are good to start with

https://www.sfdcpoint.com/salesforce/step-by-step-guide-for-using-salesforce-command-line-interface-data-loader/
http://www.chiragmehta.info/chirag/2010/03/22/salesforce-ftp-integration-data-loader-web-service-http/
https://salesforce.stackexchange.com/questions/145599/importing-data-in-salesforce-from-external-system-using-csv-file-with-ftp-serve

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Michael TomarMichael Tomar
Hi! In case you don't want spending much mony yand time on developing your own solution for this scenario, take a look at Skyvia. It's a cloud solution, that allows you to automate your manual work without coding.
So you can get your Salesforce data to CSV format and then export them to SFTP. Follow this link to learn more: https://skyvia.com/data-integration/integrate-salesforce-sftp