Ejemplo n.º 1
0
 /**
  * @Route("/descargar_acreditacion/{participant}", name="acreditation_download")
  */
 public function downloadAcreditationAction(Participant $participant)
 {
     $this->get('kernel')->getRootDir();
     $fileToDownload = $this->get('kernel')->getRootDir() . '/../private/documents/acreditations/' . $participant->getId() . '.pdf';
     $response = new BinaryFileResponse($fileToDownload);
     $response->trustXSendfileTypeHeader();
     $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $participant->getName() . $participant->getLastName() . '_acreditacion.pdf', iconv('UTF-8', 'ASCII//TRANSLIT', $participant->getId()));
     return $response;
 }