I am working on a react project using typescript. I have an excel file (.xlsx) in a folder in my project. My task is to create a button or a link on the UI and when clicked on this UI, download the file which is stored in my project folder.
I looked up a bit online and found the <a>
tag which has the href
and the download
attributes. But the href attribute is for links only.. How do we download an excel sheet or any file specified in a folder in our project?
Any help would be appreciated.