Question

Read/Retrieve file from a SFTP Location

Hi,

We have a requirement to read/write files from a SFTP server.

I have established connectivity with the SFTP server and Using Connect-FTP, I am able to write the file to the SFTP server in the folder path that was provided.

But I am not sure how to read the file from the SFTP server and save it in a location within Pega.

Any help is highly appreciated.

Thanks,

Karthik

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

Pega
December 14, 2016 - 5:06am

Have you tried file listener?

December 14, 2016 - 11:22am
Response to HabeebBaig

I believe file listeners can only poll locations within Pega App Server and cannot listen to external locations. I need a mechanism to read the file from the SFTP server into the Pega's location.

Thanks.

Pega
December 15, 2016 - 1:00am
Response to KarthikA4341

Exactly! I was just curious to know if you have tried file listener or not. Probably you need a agent here with an activity written with a java step where you can write custom java code to connect to FTP server.

 

December 15, 2016 - 3:51am
Response to HabeebBaig

Do you have a sample code that I can utilize?

Thanks,

Karthik

December 21, 2016 - 11:37am
Response to KarthikA4341