I have a database table where save the image's name.
I have to implement the edit function, and I try to do with this code :
$file = $_FILES['immagine'];
$imgpath = WWW_ROOT."img/";
$msg ="";
if (move_uploaded_file($file['tmp_name'],$imgpath.$file['name'])) {
$msg = "File uploaded.";
} else {
$msg = "Error in uploading of file.";
}
$this->data['Lavoro']['immagine'] = $file['name'];
$this->Lavoro->save($this->data['Lavoro']['immagine']);
if ($this->Lavoro->save($this->data['Lavoro'])) {
$this->flash($msg.'Refresh done.','/lavori');
}
But in the debug code cakephp never change the "immagine" field.
How I can do ?
Thanks !
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---