Upload a file, save in a local file server and filepath in BDM

I'm having difficulty in saving an attached file to a local file server and the filepath will be saved in BDM.
Does anyone have a good example for this?
Looking forward to share your approach. 
Thank you.

Now i'm stuck. thanks