Fetch URL and get the response dat and download the file (file is a zip or excel file)

Viewed 289

I need help to extract response data and save them as a gzip file. I have react with the following code. The URL successfully fetched. I want to save the file as zip or excell.

postman header

postman header

  .then((response) => {
    saveAs(
      new Blob([response.data], {
        type:
          "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,",
      }),
      "report.xlsx"
    );
  });

I have file-save

import { saveAs } from "file-saver";
0 Answers
Related