Download files phalcon

$filename=$this->dispatcher->getParam(0);

$extension = pathinfo($filename, PATHINFO_EXTENSION);

$outFile = DIR_PUBLIC.'attachments/'.$filename;

$this->output_file($outFile, basename($filename), $extension);

i get file name and path file but download notworking How to download this files.

I send a redirect response to the file, like

$this->response->redirect($outFile);

I also found a post in this forum you can refer to: https://forum.phalconphp.com/discussion/196/file-downloads