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

enter image description here

2) force download box application, says "firefox document"

enter image description here

  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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -