@@ 38-45 (lines=8) @@ | ||
35 | * @param $id |
|
36 | * @return StreamedResponse |
|
37 | */ |
|
38 | public function downloadAction(Request $request, $id) |
|
39 | { |
|
40 | $object = $this->admin->getObject($id); |
|
41 | ||
42 | $this->admin->checkAccess('show', $object); |
|
43 | ||
44 | return $this->get('mediamonks.sonata_media.utility.download')->getStreamedResponse($object); |
|
45 | } |
|
46 | ||
47 | /** |
|
48 | * @param Request $request |
|
@@ 52-59 (lines=8) @@ | ||
49 | * @param int $id |
|
50 | * @return RedirectResponse |
|
51 | */ |
|
52 | public function imageAction(Request $request, $id) |
|
53 | { |
|
54 | $object = $this->admin->getObject($id); |
|
55 | ||
56 | $this->admin->checkAccess('show', $object); |
|
57 | ||
58 | return $this->get('mediamonks.sonata_media.utility.image')->getRedirectResponse($object, $request); |
|
59 | } |
|
60 | } |
|
61 |