title: Download a excel file through Zend
body: <p>I need to give download excel files stored on server. But I am unable to find an example for download in ZF2. I am trying for the following code</p>
  
  <pre><code>$response = new Response();
  $response-&gt;getHeaders()-&gt;addHeaders(array(
      'Content-Type' =&gt; 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
      'Content-Disposition' =&gt; 'attachment;filename="forecast_template.xlsx"',
      'Cache-Control' =&gt; 'max-age=0',
  ));
  $response-&gt;setContent(file_get_contents($xlsx_file_name));
  </code></pre>
  
  <p>But it did not work. I tried setRawBody but that gave error for undefined method. Also I tried "echo $response", But that just dump string output for headers + binary data. </p>