/** * @param AttachmentDto $attachmentDto * @return BinaryFileResponse */ protected function getFileDownloadResponse(AttachmentDto $attachmentDto) { $response = new BinaryFileResponse($attachmentDto->getFilePath()); $response->trustXSendfileTypeHeader(); $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $attachmentDto->getFileName(), iconv('UTF-8', 'ASCII//TRANSLIT', $attachmentDto->getFileName())); return $response; }
private function getFileDownloadResponse(AttachmentDto $attachmentDto) { $response = new \Symfony\Component\HttpFoundation\BinaryFileResponse($attachmentDto->getFilePath()); $response->trustXSendfileTypeHeader(); $response->setContentDisposition(\Symfony\Component\HttpFoundation\ResponseHeaderBag::DISPOSITION_ATTACHMENT, $attachmentDto->getFileName(), iconv('UTF-8', 'ASCII//TRANSLIT', $attachmentDto->getFileName())); return $response; }