fileSystemService->getFile($filePath); $path = $file->getPath() . '/' . $file->getName(); $response = new BinaryFileResponse($path); $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $file->getName()); return $response; } }