Hello All,

I uploads the files to webroot/uploads folder from the file uploading
component.

Now I am trying to download that file from webroot/uploads folder but
it is giving me 0 byte file.

Code is as follows,

function admin_download($id)
    {
        $this->adminchecksession();
            // you'll want to check the login status here ...

            $result = $this->Application->findById($id);

            Configure::write('debug', 0);
            $this->view = 'Media';

            /* MediaView is really irritating
             */
            //$name = $result['Application']['resume'];

            $ext = explode("." ,$result['Application']['resume']);

            $params = array(
                    'name' => $ext[0],
                    'download' => true,
                    'extension' => $ext[1],
                    'path' => APP."webroot/uploads".DS,
                    'mimeType' => array($result['Application']
['type'])
            );

            $this->set($params);

    }


Please help me on this.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to