1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Icybee\Modules\Files;
13
14 15 16 17 18 19 20
21 class DownloadOperation extends GetOperation
22 {
23 protected function process()
24 {
25 $rc = parent::process();
26
27 if ($rc instanceof \Closure)
28 {
29 $record = $this->record;
30 $response = $this->response;
31
32 $response->headers['Content-Description'] = 'File Transfer';
33 $response->headers['Content-Disposition']->type = 'attachment';
34 $response->headers['Content-Disposition']->filename = $record->title . $record->extension;
35 $response->headers['Content-Transfer-Encoding'] = 'binary';
36 }
37
38 return $rc;
39 }
40 }