Process files before download

Hello!
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.

Is there a way to intercept these via custom code? I want to classify files on download.