Hi
I try to use the upload and image_upload behaviour of MI-BASE project
for add field photo to user model
My code is:
In model
var $actsAs= array(
'ImageUpload' => array(
'fileField' => 'photo',
'allowedMime' => array('image/jpeg', 'image/gif',
'image/
png','image/bmp'),
'allowedExt' => array('jpeg', 'jpg', 'gif', 'png',
'bmp'),
'baseDir' => '{APP}uploads',
'mustUploadFile' => false,
'overwriteExisting' => true,
'version' =>array()
)
);
In controller:
$this->data['User']['foreign_id']=$id;
$this->data['User']['dir']='users';
$this->data['User']['class']='users';
if ($this->User->save($this->data)) {
.....
}
By I get these errors:
Notice (8): Undefined variable: field [APP\models\behaviors
\upload.php, line 524]
Notice (8): Undefined index: [APP\models\behaviors\upload.php, line
524]
Warning (2):mkdir() [function.mkdir]: No such file or directory [CORE
\cake\libs\folder.php, line 465]
Is configuration wrong?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---