Hello,
If you want the user to be prompted to save the data you are sending, such as a generated PDF file, you can use the » Content-Disposition header to supply a recommended filename and force the browser to display the save dialog.
header("Content-Type: {$filetype['type']}");
header("Content-disposition: attachment;filename=\"$filename\"");
You can also check this
Adding this codes in functions.php will work fine. But before that please make sure if firefox do the downloads as you want. for that you can manually try to add any pdf file and add that code manually without any php variable.
However, If you want to force download, please always attach the file using the server file browser or upload directly using wpdm.
Thanks