voilà ce que j'ai pour le moment : le problème ce que j'obtiens cette erreur: le fichier .apk n'existe pas
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 public function downloadBuildAction($id) { $em = $this->getDoctrine()->getEntityManager(); $entityBuild = $em->getRepository('BetappliApplicationBundle:Build')->find($id); $entityApplication=$entityBuild->getApplication(); $platform=$entityApplication->getPlatform(); $fileName=$entityBuild->id.'.apk'; $dir = $entityBuild->getUploadRootDir(); $response = new Response(); $response->setContent(file_get_contents($dir.$fileName)); $response->headers->set('Content-Type', 'application/vnd.android.package-archive.apk'); $response->headers->set('Content-disposition', 'filename='. $fileName); return $response; }
Partager