I want to over write the existing cumulative file
FWIW in Appian there really isn't such a thing as "overwrite" the same way that it works in Windows and other conventional operating systems. In Appian there's no restriction on 2 files with identical names in the same folder (since the primary identifier is the Document ID which is always unique and not changeable from the front-end).
The closest thing you have in Appian to "overwriting" is the "new version" functionality, where when adding a document, it can be added as a new version of an existing one (provi1ded the extensions are identical).
You might look into implementing this via "new version", though it's not the solution I'd recommend first, honestly. The first thing I'd suggest is to simply rename incoming documents to add a clear, lexically-sortable date stamp to each one (i.e. an iso 8601 style string like "2022-07-13"). You would then simply store all of these documents separately in the same folder, and do what you need from there.
Further, if you'd like to give yourself increased power and flexibility when finding particular instances of the file, you could have a process add the Doc ID to a field of a bespoke DB table, in which you write a new row each time you receive a new version of the document - along with a "created" DATETIME column which you populate with the current timestamp upon writing. In this way you'd always be easily able to grab the latest uploaded document by using the QueryEntity function to grab the latest row and thus the latest Document ID.