symfony/symfony — pull request #2606 by jalliot (2011-11-10 21:40:59+00:00)
Title: [WIP] [HttpFoundation] Added BinaryFileResponse

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

I recently needed to force the download of a file from a controller and found that it was not very straightforward to do so using Symfony's Reponse. This PR is an attempt to fix that.

I didn't write any tests for now and I'm not sure I will have time to do so unfortunately...

This new Response type allows to do something like that in a controller:

``` php