Upload File To Third Party Mux

After doing some searching I found this very helpful Stack Overflow response:

So pretty much I still decoded file.data to Base64-encoded string via atob and then followed the steps outlined in the answer to be able to send the file to Mux or any other third party storage service.

let data = new FormData();
let byteCharacters = atob(clipSelected.file.data)
const byteNumbers = new Array(byteCharacters.length);
for (let i = 0; i < byteCharacters.length; i++) {
    byteNumbers[i] = byteCharacters.charCodeAt(i);
}
const byteArray = new Uint8Array(byteNumbers);
const blob = new Blob([byteArray]);
data.append('file', blob);