view a pdf file in the browser using the php header function

Solutions on MaxInterview for view a pdf file in the browser using the php header function by the best coders in the world

showing results for - "view a pdf file in the browser using the php header function"
Shaun
08 Apr 2020
1$file = 'headerPdfFile.pdf';
2
3$filename = 'IamPdfFile.pdf';
4  
5// Header content type
6header('Content-type: application/pdf');
7  
8header('Content-Disposition: inline; filename="' . $filename . '"');  
9  
10// Read the file
11@readfile($file);
12