Zend Framework how to set headers

前端 未结 5 1810
天命终不由人
天命终不由人 2020-12-13 09:08

I have a question, how can I do something like this:

header(\"Content-Disposition: inline; filename=result.pdf\"); 
header(\"Content-type: application/x-pdf\         


        
5条回答
  •  Happy的楠姐
    2020-12-13 09:42

    I had a header set. It was not set, but ADDED. So I had a Content-Type of text/html and also application/pdf.

    Flagging the Content-Type with TRUE made the download possible in IOS and other devices which showed only cryptic symbols after the download or an error:

    ->setHeader('Content-type', 'application/x-pdf', true);

    setHeader($name, $value, $replace = false)

    from: https://framework.zend.com/manual/1.12/de/zend.controller.response.html

提交回复
热议问题