I want to download four different files through 4 different links, I
am using Media View to download file but I have to hardcode the file
name in the download function in controller:
function download () {
$this->view = 'Media';
$params = array(
'id' => 'example.zip',
'name' => 'example',
'download' => true,
'extension' => 'zip',
'path' => APP . 'files' . DS
);
$this->set($params);
}
This works fine for one file, now for link number 2,3,4 do I need to
create 3 different actions and give different file names in them or is
there a way in which I can use download() only and depending on which
link has been clicked respective file is downloaded.
Thanks
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment