【发布时间】:2012-03-31 20:43:53
【问题描述】:
我正在尝试使用 Symfony 2 将 PDF 返回到浏览器,所以一旦找到该文件,我就会使用:
return new Response(readfile($file_path), 200, array(
'Content-Type' => 'application/pdf'
));
但如果我加载页面,标题不会被修改,内容不会被解释为 pdf...
< HTTP/1.1 200 OK
< Date: Sat, 31 Mar 2012 20:39:20 GMT
< Server: Apache
< X-Powered-By: PHP/5.3.6
< Set-Cookie: PHPSESSID=XXXX; path=/
< Transfer-Encoding: chunked
< Content-Type: text/html
我迷失了这个问题。有什么想法吗?
【问题讨论】:
标签: symfony