на nodejs Я отправляю файл следующим образом:
res.sendFile(fileName,{ root: path.join(__dirname, '../') });
при реакции Я пытался загрузить файл с помощью axios безуспешно:
let dowloadGet = async (url, auth) =>
await axiosDownload.get(url, { headers: { 'Authorization': `Bearer ${auth}` }, responseType: 'blob' });
let response = await API.get(`${this.state.BE_route}/download_script_bytest/${this.props.test._id}`, this.props.idToken)
const url = window.URL.createObjectURL(new Blob([response.data], {type:'application/zip'}));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.zip');
document.body.appendChild(link);
link.click();
link.parentNode.removeChild(link);