// in controller
public function download() {
$this->viewClass = 'Media';
// Render app/webroot/files/example.docx
$params = array(
'id' => 'example.docx', // file name
'name' => 'example',
'extension' => 'docx', // its file extension name
'mimeType' => array(
'docx' => 'application/vnd.openxmlformats-officedocument' .
'.wordprocessingml.document'
),
'path' => 'files' . DS
);
$this->set($params);
}
//In view file
echo $this->Html->url(array(
"controller" => "controller_name",
"action" => "action_name",
"ext" => "file_extension_name"
));
Также читайте Cakephp Media View
Взгляните на [этой ссылке] (http://stackoverflow.com/questions/1296085/download- файл-с помощью-JQuery) – lshettyl