@@ -20,10 +20,10 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function download(HTTPRequest $request) |
| 22 | 22 | { |
| 23 | - if(! Permission::check('ADMIN')) { |
|
| 23 | + if (!Permission::check('ADMIN')) { |
|
| 24 | 24 | return Security::permissionFailure($this); |
| 25 | 25 | } |
| 26 | - $fileName = $this->request->param('ID').'.csv'; |
|
| 26 | + $fileName = $this->request->param('ID') . '.csv'; |
|
| 27 | 27 | $hiddenDownloadDir = Config::inst()->get(ArrayToCSV::class, 'hidden_download_dir') ?: '_csv_download_dir'; |
| 28 | 28 | $path = Controller::join_links(Director::baseFolder(), $hiddenDownloadDir, $fileName); |
| 29 | 29 | return HTTPRequest::send_file(file_get_contents($path), $fileName, 'text/csv'); |
@@ -242,7 +242,7 @@ |
||
| 242 | 242 | } |
| 243 | 243 | if ($this->hiddenFile) { |
| 244 | 244 | if ($returnLinkOnly) { |
| 245 | - return '/downloadcsv/download/'.$this->fileName; |
|
| 245 | + return '/downloadcsv/download/' . $this->fileName; |
|
| 246 | 246 | } else { |
| 247 | 247 | return HTTPRequest::send_file(file_get_contents($path), $this->fileName, 'text/csv'); |
| 248 | 248 | } |