to download file the symfony way, add a download action and not to display layout unless there are errors.
in /path/to/your/app/modules/your_module/actions/actions.class.php:
public function executeDownload(sfWebRequest $request) {
$file = Do…
more »