php - Force file download PDF 'open with' box says its a Firefox document ?? -
i trying force download pdf file, works fine. problem when show "download box" says "firefox document" should "adobe acrobat document". see images, , below code using
1) force download box gmail, works fine
2) force download box application, says "firefox document"
header("pragma: public"); header('expires: mon, 26 jul 1997 05:00:00 gmt'); header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("content-type: application/pdf"); header("content-disposition: attachment; filename=\"".basename($file)."\";" ); header("content-transfer-encoding: binary"); header("content-length: ".filesize(getcwd().$file)); readfile(getcwd().$file);
for searching same issue.
the ts go solution :
add exit @ end (for reasons firefox needs this)
header("content-type: application/pdf"); echo $pdf; exit;
Comments
Post a Comment