api.get(`files/${id}`).then((r) => {
const url = window.URL.createObjectURL(new Blob([r.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', name);
document.body.appendChild(link);
link.click();
link.parentNode?.removeChild(link);
});
api.get(`files/${id}`, {
responseType: 'blob'
}).then((r) => {
const url = URL.createObjectURL(r.data);
// ...