You will need to create a recordset to return all of the files tha need to be deleted.
Then use the repeat region server behavior to loop through that recordset and inside it reference the delete file code.
It may require some hand-coding or at least moving some code around by hand after applying.