Download pdf file from href link
I am working on wordpress. I am making a meta box for PDF upload, PDF upload successfully. Now I am calling the meta value in the href link to download the pdf file. But the problem is that it can open the file but not download. For this, I am looking for a code that
<?php
header("Content-Disposition: attachment; filename=$event_flyer");
?>
$ event_flyer is used to access the meta value.
but it doesn't work for a specific href, it just works for the whole page on refresh.
+3
source to share
3 answers