'Problem in putting a download button to download a pdf file in a React Website
I'm creating a portfolio website using react and I want to add the feature of adding a download button in it so that anyone could download my resume through the portfolio site.
<Link to="Resume.pdf" download>Download</Link>
I put the above code for it but it doesn't download my resume. Can I get some ways that I could make it work?
Solution 1:[1]
Lets consider that your resume.pdf file is present in a same folder. You can import the file and pass it as a variable.
import resume from './Resume.pdf';
<Link to={resume} download>Download</Link>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Yadab |