我想允许用户下载文件,因此所有工作只是因为
而附加html
Content-Type: text/html
我设置了标题
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private',false);
header('Content-Encoding: UTF-8');
header('Content-Type: application/pdf');
header('Content-Disposition: attachment;filename=pdf_'.date("d_m_Y_G_i").'.pdf');
header('Content-Transfer-Encoding: binary');
但是当我检查标题时,它总是Content-Type: text/html
。为什么?