Download Dialog Not Popping Up in Edge Browser

72 views Asked by At

I am getting a blob and I am embedding that into a hidden tag. I use a button to trigger the function which sets the href to url created and then do a click. The file is being downloaded but in the background whereas in Chrome as soon as the file is downloaded I get that download popup with the filename. Opening the URL using window.open(url,'_blank') solves this but I am not able to get the desired filename in that method.

    const url = URL.createObjectURL(blob);
    setFileDownloadUrl(url);
    downloadLinkRef.current.download = filename;
    downloadLinkRef.current.target = "_blank";
    downloadLinkRef.current.click();

I have tried using all the target values but that didn't work

0

There are 0 answers