How to upload from BUFFER?

Like most I find myself reading this post because I have a use case where
I need to specify the path name of the file I upload.

We initially look at the upload button, but its function for https://www.wix.com/velo/reference/$w/uploadbutton/startupload
won’t allow this, it places everything in root ‘Vistor Uploads’ folder.

This article looks like the right solution but leave some big learning curve challenges between using the uploadbutton and this backend code.
a) how does one create and lunch a media sector/file picker to place in the buffer? (now we no longer use the upload button)
b) what was the actual answer to how to encode that buffer correctly. Not here, instead left to be “figured out” in what quite a messy post.
c) its backend code, we need to do something about using this and we cannot in preview? Or we need to have separate front end code somewhere?

any help on the questions above is appreciated.