Content-Type始终为text / html

时间:2013-08-20 14:22:52

标签: http-headers

我想允许用户下载文件,因此所有工作只是因为

而附加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。为什么?

0 个答案:

没有答案