const downloadBlobFile = (id, fileName) => {
fetch(`${API_URL}/files/download/${id}`)
.then(response => {
return response.blob()
})
.then(blob => {
const link = window.document.createElement("a");
link.href = window.URL.createObjectURL(blob);
link.download = fileName || 'file';
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
})
.catch(() => {
//Обработка ошибок
});
}