Re: Media view not working

2009-02-09 Thread Miles J

Ah nvm, it seemed I had the filename misspelt. Stupid me.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Media view not working

2009-02-09 Thread Miles J

So im trying to get this media view working, but it doesn't seem to
force the download. All it does is show a white page and the query
output, any ideas? Heres my action:


/**
 * Downloads a file
 * @param int $upload_id
 * @return media
 */
function download($upload_id) {
$this->view = 'Media';

$file = $this->Upload->find('first', array(
'conditions' => array('Upload.id' => $upload_id),
'contain' => array('Current')
));

if (!empty($file)) {

$this->Upload->increaseDownloadCount($file['Current']['id']);
}

$params = array(
'id' => $file['Current']['filename'],
'name' => $file['Upload']['name'] .' v'. 
$file['Current']
['version'],
'download' => true,
'extension' => $file['Current']['type'],
'path' => 'files'.DS
);

$this->set($params);
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---