In a template which I've made, I want to add the ability to force a download (so that it gives the user the option to open the file or save the file).
Now I have linked this page as
<a href="resumepdf"> </a>
Now in the resumepdf.php
<?php
/*
Template Name: ResumePdf
*/
?>
and then I have
<?php
header('Content-disposition: attachment; filename=resumepdf.pdf');
header('Content-type: application/pdf');
readfile("echo bloginfo('template_directory');/about/resume/resumepdf.pdf");
?>
But while the size of the pdf is about 270KB , the size of the downloaded pdf is just 5kb.
Can someone give me the correct way to force download in the template. Btw to embed pdf this works
<embed src= "<?php echo bloginfo('template_directory');?>/about/resume/resume.pdf"/>