| Conditions | 1 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | public function run() { |
||
| 20 | $file = \yii::getAlias($this->publicPath) . '/' . $this->fileName; |
||
| 21 | $response = \Yii::$app->getResponse(); |
||
| 22 | $response->setDownloadHeaders($this->fileName, mime_content_type($file)); |
||
| 23 | |||
| 24 | $response->sendContentAsFile(file_get_contents($file), $this->fileName); |
||
| 25 | |||
| 26 | return $response; |
||
| 27 | } |
||
| 28 | } |