I have an anchor tag (a href
) defined with the path for my resume. The resume is in the public folder in a folder but when i click on the "My CV" button all i get back is Failed no file?
Asked
Active
Viewed 321 times
0
-
did you checked this https://stackoverflow.com/questions/50694881/how-to-download-file-in-react-js – Tr0jAn Jul 13 '22 at 09:57
-
Maybe try `./resume/myCV.pdf`? – Andy Jul 13 '22 at 09:58
2 Answers
1
just checked on my code, seems you need to place a tag inside the button not above:
<button>
<a
href='/pathToPdf.pdf'
target='_blank'
rel='noopener noreferrer'
>
RESUME
</a>
</button>

antokhio
- 1,497
- 2
- 11
- 16
0
As i see remove {} from href attribute because it's not JavaScript code then in download meta-attribute you should put your file extenstion ".pdf"
<button>
<a
href="./public/file.pdf"
download="mycv.pdf">
Save
</a>
</button>

Adarsh Madrecha
- 6,364
- 11
- 69
- 117

Monam Ben Gouta
- 11
- 3