On Nov 27, 6:40 pm, mbavio <[EMAIL PROTECTED]> wrote:
> Hi, I´m trying to solve an upload problem. I want to upload images,
> and in the same processe some thumbnails of different sizes have to be
> done too. I´ve checked some behaviours that seems to do that (AD7six
> behaviour, ActAs Image behaviour, digitalspaghetti behaviour) and some
> components (Image Upload Component) but I cant figure out if these
> behaviours create the images in the file system or directly in the
> database. Can anyone help me?
>
> Thanks. Martin
I know that ditital's and my behaviors store the files on the file
system and meta data in the db.
For the generic upload behavior (for which there is a sample
application on cakeforge in the noswad project) if you want to
generate the thumbs on save, you don't configure that; you'd add
something like this to your model afterSave function:
function afterSave($created) {
if ($created) {
$path = IMAGES . 'thumbs' . 'pic.jpg';
$path2 = IMAGES . 'thumbs' . 'pic_ito.jpg';
$this->resize(null, $width, $height, $path);
$this->resize(null, $width/2, $height/2, $path2);
}
}
OR you could add the calls in your image upload behavior in the
_afterProcessUpload method if you wanted.
hth,
AD
PS. Note that the sample application shows an example of use, it
doesn't show the only way you can/should use the generic upload
behavior.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---