Process files before download

Is it possible to intercept all requests to download / show file previews and pre-process files, for example, insert a watermark with the name of the current user? And do it “on the fly” when downloading, saving the original file. I did not find any suitable events or other extension methods.