How to make firefox to correctly set the default file name .pdf, if the url is extension .html?

Generate a pdf file in the headers I send header('Content-type: application/pdf');
Link to the script has the track view root/gen_pdf/name_file.hml?get_params
The document should display on preview with the possibility of further saving.
Chrome and Opera menu PREV. view prompt you to save the file as name_file.pdf , Firefox menu PREV.view the file name as the document specifies.pdf.
If the browsers are set to automatically download pdf: Chrome/Opera download file name_file.pdf; Firefox file name_file.html.
What are the solutions to firefox by default set the file name name_file.pdf
June 10th 19 at 16:58
1 answer
June 10th 19 at 17:00
Try to add response header
Content-Disposition: attachment; filename="filename.pdf"
Thus, the document begins to download, it is necessary that he first went on the preview - Willa.Smith36 commented on June 10th 19 at 17:03
try Content-Disposition: inline; filename="foo.pdf" - ale commented on June 10th 19 at 17:06

Find more questions by tags Mozilla FirefoxBrowsersPHPPDF