I have a backend service writted in Java that will power the vue frontend app. I need to start the download of a file when it will be provided from the backend. At the moment I’ve noticed that the response fro the backend that will provide the file is an object. The object have this structure:
{
data: "..." //This is supposed to be a blob
}
How I can convert the response to an xls file correctly? I’ve tried to pass it to the File consctructor but the resulting file seems corrupted.
getXlsFile(data)
.then( (res) => {
let file = new File([res?.data], 'report.xls');
...
})
Not sure if I need to convert the response in a blob again?