Delete a file using File Listener

We are using Pega 7.1.7 and in one of our applications we use File Listener to pickup the excel files and process it. Once it is processed we store in a different path. Now these processed excel files are piled up. We a have a requirement to delete these processed excel files.

Do we have a functionality to delete a folder / files? Any pointers would be helpful.


**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.


Keep up to date on this post and subscribe to comments

December 12, 2017 - 12:34am

Hi Satyakanth,

You can delete the file once processing is done.  You can find this option in process tab of file listener data instance.

File Operation

Select Keep or Delete. After an input file is successfully processed, it can be kept or deleted. The system moves kept files to the Completed file folder.

Consider total disk space requirements if the input files are large and you select Keep.

December 12, 2017 - 8:13am


Already processed files, you need to clear manually for upcoming files you can change the listener configuration to keep or delete in process tab of the file listener.

December 13, 2017 - 8:55pm
Response to SudhakarReddy

Thanks all for your response!

We wanted to delete all those old processed excel sheets which have been accumulated since 3 to 4 years. Wanted to setup some archival/purging mechanism going forward.


December 16, 2017 - 3:31am
Response to Satyakanth

Usually customers follow the same based on their requirement to delete immediatly or schedule deletion process periodically.

December 17, 2017 - 11:02pm
Response to SudhakarReddy

Yep, I wanted to know whether we can schedule process to delete older excel files.


December 17, 2017 - 11:38pm
Response to Satyakanth

Hi Satya,

Why don't you schedule an agent to run on a weekly basis with Custom criteria to delete the files.



December 27, 2017 - 8:57pm
Response to eppik

Thanks for the reponse Karthik!

Do we have any OOTB delete rule which does this? Bcoz this needs to delete a file in some location.