I am having issue with setting headers for xls file while downloading through Zend Framework.
I have tried this but not working...
$this->getResponse()
->setHeader('Content-type', 'application/vnd.ms-excel')
->setHeader('Content-Disposition', 'attachment; filenam开发者_StackOverflowe=test.xls');
Still it shows some binary data. and not setting headers.
Please help me though this.
Try
->setHeader('Content-type', 'application/vnd.ms-excel', true)
Use true in the third argument to force replacement of the header
and add
->setHeader('Content-Length', ...)
精彩评论