Try this:

if (!empty($this->data))
{
        $currentFile = $this->params['data']['File']['imgpath'];

        $filePath = WEBROOT_DIR . DS . $currentFile['name'];
 
        if (is_uploaded_file($currentFile['tmp_name']) &&
move_uploaded_file($currentFile['tmp_name'], $filePath))
        {
                echo "No Error";
        }
}

-MI

---------------------------------------------------------------------------

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar


-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de [EMAIL PROTECTED]
Enviado el: Jueves, 22 de Febrero de 2007 09:12 a.m.
Para: Cake PHP
Asunto: move_uploaded_file function


I want to upload an image file . The file must not save in the
database it shoud be saved in the ..\webroot\img\.. folder. Only the
path of the image is to be stored in the database.

In controller file Coding is as follows


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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