Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
59 | public function download() |
||
60 | { |
||
61 | if (isset($this->urlParams['ID'])) { |
||
62 | $id = Convert::raw2sql($this->urlParams['ID']); |
||
63 | |||
64 | if (is_numeric($id)) { |
||
65 | /** @var File $file */ |
||
66 | $file = File::get()->byID($id); |
||
67 | $response = HTTPRequest::send_file(file_get_contents($file->getFilename()), $file->Name); |
||
68 | $response->output(); |
||
69 | } |
||
70 | } |
||
71 | |||
72 | // todo |
||
73 | return $this->redirectBack(); |
||
74 | } |
||
75 | } |
||
76 |