View A Pdf File In The Browser Using The Php

[Solved] View A Pdf File In The Browser Using The Php | Lisp - Code Explorer | yomemimo.com
Question : view a pdf file in the browser using the php header function

Answered by : sleepy-scarab-b2t45feyesjo

$file = 'headerPdfFile.pdf';
$filename = 'IamPdfFile.pdf';
// Header content type
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
// Read the file
@readfile($file);

Source : https://www.quizcure.com/php/header-pdf-open-in-browser | Last Update : Sun, 10 Oct 21

Answers related to view a pdf file in the browser using the php header function

Code Explorer Popular Question For Lisp