PDF Viewer Save dialog box shows source code file name as default
I am rendering a PDF correctly using SSRS SDK for PHP, and it is being displayed in viewer correctly. But, when I click the save button on the Adobe Reader, the dialog box shows the name of the source files name rather then the name I pass in via HTTP Header. here is my code:
header('Content-Type: application/pdf; filename="'.basename($reportName).'";');
header('Content-Disposition: inline; filename="'.basename($reportName).'";');
header("Content-length: ".(string)(strlen($result)));
header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")+2,
date("i"), date("s"),
date("m"), date("d"),
date("Y")))." GMT");
hea开发者_StackOverflowder("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("cache-control: max-age=1");
Found solution. Tested in Chrome, Safari, IE8, IE7, IE6 Add the filename to end of URL
ex:
ShowPDF.php/Myfilename.pdf
精彩评论