How to post a multipart/form-data from wix media?

Hi i am looking for a way to create a post to a 3rd party api which require a multipart/form-data
The body i have to send is composed by a json payload and a file wix is stored in wix media or as an item in the wix database.Here is my code. Any idea?

export async function uploadFile() {
const basicUrl="https://sandbox.esignlive.com/api"
var requestURL = basicUrl + "/packages";
console.log("starting function")
// convert Wix URL to https:
// => You will need to write the function
// convert the file to readable stream
let fileUrl = "public url of my file in wix media";
var blobRes = await fetch(fileUrl)
var blob = await blobRes;
//console.log(blob)
let toSend = {
payload: JSON.stringify({
"name": "Example Transaction: ",
"description": "Created using SWAGGER and TextTags",
"type": "PACKAGE",
....
}),
file: blob
}
console.log({toSend});
let payload = getFormData(toSend);
let res = await fetch(requestURL , {
method:"POST" ,
headers: {
'Content-Type': "multipart/form-data"
},
body: toSend
})
console.log({res})
let json =  res.json();
return json;
}

function getFormData(data) {
if(data === undefined) return;
let {something, file} = data;
let formdata = new FormData();
console.log("created")
formdata.append("file", file);
formdata.append("payload", something);
return formdata;
}

Hello, I am looking for similar functionality but have not found an answer or solution yet.
@Yisrael (Wix) - can you please comment here - is it possible and how or if it is not possible with Wix - just to be clear ?
Thank you very much !
Vasil

Small update on this:
installing npm module “form-data” i can now submit correct form-data containing strings. I still have problems in submitting file because the form-data npm only accept readablestream or buffer for file submission. Anyone has idea how to convert the body of the get request to a readablestream ?

Hi , i still have same problem… Anyone can help me ?