chg: [API] new restresponse library addition fixed (send file)

pull/3729/head
iglocska 2018-10-01 14:48:00 +02:00
parent 759e465252
commit 74916368b5
1 changed files with 4 additions and 4 deletions

View File

@ -379,12 +379,12 @@ class RestResponseComponent extends Component
return $this->__sendResponse($data, 200, $format, $raw, $download);
}
public function sendFile($path, $format = false, $download = false) {
public function sendFile($path, $format = false, $download = false, $name = 'download') {
$cakeResponse = new CakeResponse(array(
'status' => $code,
'type' => $type
'status' => 200,
'type' => $format
));
$cakeResponse->file($path);
$cakeResponse->file($path, array('name' => $name, 'download' => true));
return $cakeResponse;
}