PDF file shown symbols on live server while fetched from database, but displayed correctly on local sever. I don’t know exactly what I am doing wrong.
Below is my code
<?php
if(ISSET($_REQUEST['file'])){
$file = $_REQUEST['file'];
// Add header to load pdf file
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' .$file. '"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
// @readfile($file);
@readfile("files/".$file);
}
?>