-
-
Save mantismamita/899909f2ae5478cc6257 to your computer and use it in GitHub Desktop.
Php function to force download a pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Disposition: attachment; filename=' . urlencode($f)); | |
header('Content-Type: application/force-download'); | |
header('Content-Type: application/octet-stream'); | |
header('Content-Type: application/download'); | |
header('Content-Description: File Transfer'); | |
header('Content-Length: ' . filesize($f)); | |
echo file_get_contents($f); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment