Problems generating downloadable files

Feb 16, 2010 at 3:03 PM

Hi every:

I'm using PHPExcel from Symfony using sfPHPExcel plugin. I need the generated file can be downloaded by the user and for this I have included this code


$objWriter = PHPExcel_IOFactory::createWriter($excel, 'Excel2007');

When I run the function I get a stack of strange characters and not let me download anything, anyone know where it fails?

Greetings and thanks in advance

Feb 16, 2010 at 4:53 PM

From the description of the output, it looks as though the http headers are being ignored

I don't know Symfony, although there's a couple of threads about using PHPExcel with Symfony here on the board.


I always include

Content-Transfer-Encoding: binary

among my http headers

Feb 16, 2010 at 6:04 PM

Niet, it don't works

Feb 16, 2010 at 10:16 PM

I have no experience with Symfony either, but are you checking that headers are set as expected?

You can for example use the Live HTTP Headers add-on for Firefox to check.