symfony: setHttpHeader() doesn't work, header() does
问题 I built a simple action in symfony which generates a PDF-file via wkhtmltopdf and outputs it to the browser. Here's the code: $response = $this->getResponse(); $response->setContentType('application/pdf'); $response->setHttpHeader('Content-Disposition', "attachment; filename=filename.pdf"); $response->setHttpHeader('Content-Length', filesize($file)); $response->sendHttpHeaders(); $response->setContent(file_get_contents($file)); return sfView::NONE; That works fine in my local development