I am using the following code to stream a pdf to the browser:
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public");
header("Content-type:application/pdf");
header("Content-Disposition:attachment;filename=file.pdf");
echo $pdf;
Works fine, except (in Chrome anyhow) it just saves the file “file.pdf” – it does not prompt a Save As dialog so I can rename the file, if I choose.
I suspect this may be one of those browser-dependent things, but is it possible to force a Save As dialog with the php headers when streaming a pdf for download?
Thanks (in advance) for your help
They most likely have Ask where to save each file before downloading unchecked (Advanced Settings). If this is the case, there’s nothing you can do as this is their preference.