Get file data from media manager

i want to convert a file to a buffer and base64 to send it to a an api but when i use the uploadFiles button i dont know how to call the file to make the conversion

If you just need the fileUrl to convert to Buffer or Base64 APIs, you just get the response from the promise of the uploadFiles button.

export async function button_click(event) {
    if ($w('#uploadButton').value.length > 0) {
        const upload = await $w('#uploadButton').uploadFiles()
        //If you are going to upload multiple files,
        //you are going to need to use a array function to deal
        //with the multiple responses in the array
        const fileUrl = upload[0].fileUrl
        //Use this fileUrl to feed the API you need.
    } else {
       console.log('Please choose a file to upload.')
    }
}

thank you bruno!