> Can you give some instructions?
>
save http://bin.cakephp.org/saved/17539 as app/models/behaviors/
upload.php
then in your model, ex post:
<?php
class Post extends AppModel
{
var $name = 'Post';
var $actsAs = array('Upload' => array(
'image' =>
array('dir' => 'img/posts',
'allowed_mime' => array('image/png', 'image/jpeg', 'image/pjpeg'),
'allowed_ext' => array('jpg', 'png'),
'overwrite_existing' => true,
'create_directory' => true
)
)
);
}
?>
Because I'm always uploading images and resizing them I tweaked a
litle this behaviour and put in it some code to make it upload and
resize behaviour, then I only put it in the behaviours directory an
use actsAs in my model. Also put some code to clean the mess when
deleting the Post (delete the image an its thumbs). If you think it
can be useful for you, then just tell me and I will paste it on the
bin (http://bin.cakephp.org).
> Thanks a lot!
You're wellcome.
Bye, Dardo Sordi.
P/D: Nice to meet an itallian, I'm argentinian (with an italian
grandfather).
> bye
>
> Andrea
>
> P/D: I'm an Italian speaker...
>
> On 30 Mag, 15:51, dardosordi <[EMAIL PROTECTED]> wrote:
>
> > Hi Andrea,
>
> > I'm using this for file uploading in 1.2 an works like a charm
>
> >http://bin.cakephp.org/saved/17539
>
> > Here is how it works:
>
> >http://blog.chris-partridge.info/2007/03/16/uploadbehavior-is-here/
>
> > Hope it helps.
>
> > P/D: Are you spanish speaker?
>
> > On May 29, 1:48 pm, Andrea <[EMAIL PROTECTED]> wrote:
>
> > > Hi to everybody!
> > > I want to upload a file that I choose from a field of a form. How can
> > > I do this action?
> > > With the previous stable Version of Cake I do this, with the aid of
> > > this extension:http://www.reversefolds.com/articles/show/filehandler
> > > With this new version the controller always say to me that I don't
> > > give to it the file.
>
> > > In particular I want to upload an image.
>
> > > Help me, please :D
>
> > > Thanks
>
> > > Ps. Sorry for my bad English!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---