I have stored the file in my Firebase storage and I got the download URL as well. How do I initiate download in the browser? Right now it is only opening a new window with the file. Here is what I tried:
downloadFile=(file)=>{
var element=document.createElement('a');
element.style.display= "none";
element.setAttribute('href', file.fileUrl)
element.setAttribute('download', file.filename)
document.body.appendChild(element)
element.click()
document.body.removeChild(element)
}