1 | <?php |
||
8 | trait ResponseUtilsTrait |
||
9 | { |
||
10 | protected function generateDownloadFileResponse($filePath) |
||
11 | { |
||
12 | return $this->generateBinaryResponse($filePath, [ |
||
13 | 'Content-Disposition' => 'attachment; filename=' . basename($filePath), |
||
14 | 'Content-Transfer-Encoding' => 'Binary', |
||
15 | 'Content-Description' => 'File Transfer', |
||
16 | 'Pragma' => 'public', |
||
17 | 'Expires' => '0', |
||
18 | 'Cache-Control' => 'must-revalidate', |
||
19 | ]); |
||
20 | } |
||
21 | |||
22 | 1 | protected function generateImageResponse($imagePath) |
|
26 | |||
27 | 1 | protected function generateBinaryResponse($path, $extraHeaders = []) |
|
35 | } |
||
36 |