symfony - download files
<p>I am trying download files in controller but in the console I see only really bunch of weird characters instead of download box. I am following this topic <a href="https://stackoverflow.com/questions/13010411/symfony2-force-file-download">Symfony2 - Force file download</a>.</p>

<p>Don't know what is going on... trying to find simplest solution. 
Here is my code:</p>

<pre><code> $response = new Response(file_get_contents($file-&gt;realPath), 200, array(
            'Content-Type' =&gt; $file-&gt;mimeType,
            'Content-Length' =&gt; filesize($file-&gt;realPath),
            'Content-Disposition' =&gt; 'attachment; filename=' . $file-&gt;name,
        ));
 $response-&gt;send();
</code></pre>

<p>I've even tried to use the most basic example with header() and readfile().
Does my server need special config or something? Cheers.</p>