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