0

How to make a button that directly downloads a pdf CV/Resume using html thank you devs

Download CV- /*Downloading PDF*/

9th Jul 2022, 9:22 AM
Kuro Chi
Kuro Chi - avatar
7 Respostas
+ 1
If you want to do it without JavaScript. Use a form with a submit button, "action" pointing to the resource and "method" set to get. This will make a get request to fetch the file. Just like pressing a link. If you want to fetch the file dynamically from inside the website, you will have to you JavaScript.
11th Jul 2022, 7:29 AM
Mustafa A
Mustafa A - avatar
+ 1
Just stick with the html solution. It will get unnecessarily complicated with JavaScript. This is the standard way anyways.
12th Jul 2022, 6:50 AM
Mustafa A
Mustafa A - avatar
+ 1
You can Google the JavaScript way if you want.
12th Jul 2022, 6:51 AM
Mustafa A
Mustafa A - avatar
+ 1
You could also set target="_blank" In your form to start the download in a new tab. Instead of leaving your site.
12th Jul 2022, 6:53 AM
Mustafa A
Mustafa A - avatar
+ 1
Thank you sir appreciate it
12th Jul 2022, 6:54 AM
Kuro Chi
Kuro Chi - avatar
0
How to do it with javascript sir
12th Jul 2022, 6:47 AM
Kuro Chi
Kuro Chi - avatar
0
You're welcome
12th Jul 2022, 6:55 AM
Mustafa A
Mustafa A - avatar