Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Action to download a zip package of documents according to a user with.
- *
- * idDocuments array of id documents to download
- *
- * @Route("/user/documents/download/zip", name="downloadDocumentZipAPI")
- *
- * @param Request $request
- *
- * @return Response
- */
- public function downloadZipAction(Request $request)
- {
- $idUser = $this->getUser()->getId();
- $idDocuments = $request->get('idDocuments', []);
- $documentsBinary = $this->getClient()->downloadZIPUserDocuments($idUser, $idDocuments);
- if (!$documentsBinary) {
- return new JsonResponse(['statusCode' => 404], 404);
- }
- $response = Response::create($documentsBinary->getBody()->getContents(), $documentsBinary->getStatusCode(), $documentsBinary->getHeaders());
- return $response;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement