php header pdf open in browser

Solutions on MaxInterview for php header pdf open in browser by the best coders in the world

showing results for - "php header pdf open in browser"
Cecilia
03 Jul 2018
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
Salomé
22 Oct 2016
1<?php
2header("Pragma: public");
3    header("Expires: 0");
4    header("Accept-Ranges: bytes");
5    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
6    header("Content-Type: application/pdf");
7    header("Content-Disposition: attachment; filename=order.pdf");
8    header("Content-Transfer-Encoding: binary");