js-file-download
js-file-download copied to clipboard
Downloading in the background and when finished then showing on browsers
Am getting a nodejs stream file as response and am using axios to receive the file, and the using js-file-downloader to download the file. The problem is that it is being downloaded in the background, i can see it in the network tab in dev mode, and the file is completely downloaded then it's showing that the file is downloaded in chrome. How can i fix this... i have found an alternate solution but its no good, i want it to show that its downloading on the browser from the start. Thank you for your help...
`axios({
method: 'post',
url: '/api/download',
data: { itag, url: search, length: size },
responseType: 'arraybuffer',
onDownloadProgress: (progressEvent) => { let percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total) setPercentage(percentCompleted) if(percentCompleted === 100 ) { setPercentage(0) setIsDownloading(false) } }
}).then((response) => {
console.log(response)
fileDownload(response.data, 'video.mp4')
});`
I have the same problem..
Have you find a solution for this?