I am working on a chat application using flask-socketIO. I am allowing user to send files which I store in firebase using the pyrebase4 module.
I am successfull in saving file to firebase and displaying according to the type of file.
When the file is not audio,video,image , I make a <a> tag with download attribute and pass the firebase file link.
I want the file to be downloaded on click on the link. But rather downloading it takes me to the file.
I have searched various questions stating how to make a downloadable link. but none of them is working and it still takes me to the file.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<a href="https://firebasestorage.googleapis.com/v0/b/flask-chat-9e187.appspot.com/o/e7a74b994ac84bebf46748a3e144d5charchitchat.js?alt=media&token=d46645d7-39e3-43f1-bcf0-9b4931c7c111" download>download</a>
</body>
</html>
I tried making a get request to the file and getting it's body but it gives the following error
No 'Access-Control-Allow-Origin' header is present on the requested resource
I have tried no-cors but it returns opague response without body.
My main purpose is to download the js file on this link I want to know how I can make the link downloadable so that user can download the file on click.
Thanks in advance.