I am using below php to open pdf, it is working in Windows browser (eg. Windows Google Chrome), but failure to open by Mobile App (eg: Android Google Chrome), it will be download instead of open.
<?php
$com_no = $_POST['comno'];
$date = $_POST["date"];
$name_of_doc = $_POST["name_of_doc"];
// Store the file name into variable
$file = $com_no.'.pdf';
$filename = $date."_".$name_of_doc;
// Header content type
header('Content-type: application/pdf');
header('Content-disposition: inline; filename="'.$filename.'.pdf"');
header('Content-Transfer-Encoding: binary');
header('Accept-Ranges: bytes');
// Read the file
@readfile($file);
?>
How shoule I rewrite it to support both open in the Windows and Mobile ? Thank you very much !