0
所以基本上我試圖下載一個文件。CakePHP下載文件錯誤
我有行動:
public function getfile() {
$this->autoRender = false;
$accesskey = 'mrPQVeJF8VFXpSq';
$data = $this->File->find('first', array('conditions' => array('File.accesskey =' => $accesskey)));
$filepath = substr($data['File']['path'], 17);
$this->response->file($filepath, array('download' => true, 'name' => $data['File']['name']));
return $this->response;
}
,這將引發一個錯誤:(我猜有$行這個 - >響應 - >文件())
Fatal Error Error: Class 'File' not found File: C:\wamp\www\project\lib\Cake\Network\CakeResponse.php Line: 1347