How to force a Save As dialog when streaming a PDF attachment

后端 未结 3 1855
情深已故
情深已故 2021-01-07 11:53

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         


        
3条回答
  •  时光取名叫无心
    2021-01-07 12:19

    That behavior is controlled by the browser settings, so I don't think theres a way to force the "Save as" dialog to be opened.

    You could try not specifying a name for the file, but I do think that it will just inherit the scripts name instead.

提交回复
热议问题