I made a simple downloadable response from my express server.
app.post('/download', (req,res)=>{
let file_name = req.body.name
res.download(path.join(__dirname, `files/${file_name}.mp3`), err => {
console.log(err)
})
})
And I used axios and js-file-download to download the responsed file from frontend. The file is donwloaded with full file size. But it’s not playable.
Axios.post("http://localhost:3001/download", {name : name}).then((response)=>{
fileDownload(response.data, `${title}.mp3`);
})
How can I solve this problem?