We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Download files phalcon


$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


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