Auto save attachment to a folder

Things I have tried

Is it possible to have a template that when it opens and is created, if I add an attachment to it, it will auto save to a certain folder?

What I’m trying to do