I like how you left my snarky comment in the code I'd posted :-)

Try commenting out the Configure::write('debug', 0) and, after you've
set the $params array, put:

die(debug($params));

... so that you can see if the values are all what you're expecting.

Of course, you should also ensure that the file is where you think it
is and that the permissions allow the server to read it.

On Thu, Jul 23, 2009 at 10:44 AM, Vijay<k.vidn...@gmail.com> wrote:
>
> 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