Symfony 2: Sending a file to download from controller

Here is a snippet how to send a file to download. It creates a zip archive and sends it. <?php namespace Acme\DemoBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\ResponseHeaderBag; … Continue Reading &rarr;