Wednesday, February 2, 2011

Missing Behavior File

Hi,

I'm new to cakephp currently trying out this plugin .

https://github.com/webtechnick/CakePHP-FileUpload-Plugin

I basically followed everything in the readme file. I'm just creating
a simple blog app for studying purpose and I'm trying to combine it
with the file upload.

Here's what i did
I created an Upload Model.

<?php
class Upload extends AppModel {
var $name = 'Upload';
var $actsAs = array('FileUpload.FileUpload');
}
?>

Created a table.

CREATE TABLE IF NOT EXISTS `uploads` (
`id` int(11) unsigned NOT NULL auto_increment,
`name` varchar(200) NOT NULL,
`type` varchar(200) NOT NULL,
`size` int(11) NOT NULL,
`created` datetime NOT NULL,
`modified` datetime NOT NULL,
`post_id` int(11) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

made the relation to the post model

<?php
class Post extends AppModel{
var $name = 'Post';
var $hasMany = array('Comment','Upload');

//some more code here
?>

When I try to save a Post. It says

Error: The Behavior file app\models\behaviors
\file_upload.file_upload.php can not be found or does not exist.
Error: Create the class below in file: app\models\behaviors
\file_upload.file_upload.php

How do I use a plugin? it seems it is not looking for the files in the
plugins folder. Is there some setting like in the bootstrap.php I need
to change so that the app knows where this plugin is?

Hoping to get some help.

Thanks,
Milo

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: