Last active
June 2, 2016 14:17
-
-
Save CodeBrauer/e6a37d7aed9a5957f1c35b2b1dc686f3 to your computer and use it in GitHub Desktop.
Open PDF instead downloading it with php
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 | |
| /* instead using this headers | |
| header('Content-type: application/octet-stream'); | |
| header('Content-Disposition: attachment; filename="'.$filename.'"'); | |
| // use this headers */ | |
| header("Content-type: application/pdf"); | |
| header("Content-Length: ".$length); | |
| header("Content-Disposition: inline; filename=\"".$filename."\""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related: