Created
March 29, 2021 17:15
-
-
Save Splint3r7/81661d9ef5e59c669bfcac650d53f707 to your computer and use it in GitHub Desktop.
Read pdf files
This file contains hidden or 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 | |
$file = 'test.pdf'; | |
$filename = 'test.pdf'; /* Note: Always use .pdf at the end. */ | |
header('Content-type: application/pdf'); | |
header('Content-Disposition: inline; filename="' . $filename . '"'); | |
header('Content-Transfer-Encoding: binary'); | |
header('Content-Length: ' . filesize($file)); | |
header('Accept-Ranges: bytes'); | |
@readfile($file); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment