Download file from IPFS onClick of button

Hello guys, I wanna download a pdf onClick of the button from IPFS so I tried the below code.

const downloadURL = `https://${cid}${fileName}?filename=${fileName}`;

// const downloadURL = `https://${cid}${fileName}?download=true`.

console.log( downloadURL, 'DownloadUrl from storeFiles');


However, both download URL is just redirecting to that pdf and It doesn’t download that pdf file. so any help, please!
Thank you.