Uploading to specified folder in Media Manager

Can someone please break this down in a way that can be followed clearly? I read through the links, and the information is all over the place. For example:

I can upload just fine using the button.uploadfiles(). The issue is that I’d like to be able to create a folder and then upload the images to that folder. I do not see a way to do this using the button’s exposed methods. This current post appears to have a solution but is difficult to follow. For example, I copied and pasted the code above as a starting point, and I got an error with the first line.

import { mediaManager } from ‘wix-media-backend’ ;

Cannot find module ‘wix-media-backend’ or its corresponding type declarations.

I have a general understanding of how the Wix back-end works but seeing the process in the context of finding a solution to this specific problem will go along way.

I’m requesting the specific steps to accomplish the exact task of uploading to a specified folder and returning the Wix URL… All using Wix code.

For example

  1. What needs to be done to get access to wix-media-backend?

  2. What is the buffer-source / buffer-data and how do you get it?

  3. How do you create and HTML-Component-File-Selector in WIX?

  4. How do you use it to get all needed info, including base-64-code?

  5. How do you send all the gathered data to your site?

  6. How do you use the provided code from Wix-API on back-end(send DATA to backend)

  7. How do you handle the data on the backend

  8. What is the code I’d use for the button click method?

A lot of people would benefit from a straightforward, easy-to-follow solution. If anyone got this to work, please highlight your steps.

Thank you in advance.