$response = $this->response->withFile( $file['path'], ['download' => true, 'name' => 'foo'] ); return $response;
dowloading a file but file always crrupted Why so?
Whats the file type? Sometimes you need send the header to browser with the type of the file to work corretly.
$this->RequestHandler->respondAs('pdf'); $this->response->withHeader('Content-type', 'application/pdf');