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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to