$path = '/path/to/file.ext' $response = new Response(); $response->headers->set('Content-type', 'application/octect-stream'); $response->headers->set('Content-Disposition', sprintf('attachment; filename="%s";', 'fileName')); $response->sendHeaders(); $response->setContent(readfile($path));