My API returning application/octet-stream response which I am able to download in zip format. But I want to extract the zip into an actual file before downloading.
fetch('./api'). // its returnType: arraybuffer
.then((result) => {
const blob = new Blob([result.body], { type: "application/octet-stream" }); // converting to blob
//--------
// Here Before downloading the file I want to extract and download the actual file
//--------
saveAs(blob, fileName); // file-saver lib using to download
});