You can maybe do it manualy : don't use Media.Transfer
But i don't know if you can use Media transfert methods in your
controller after saving the post.
something like that :

function add() {

        $this->Post->create();
        if ($this->Post->save($this->data)) {
                […]
                $dirname = 
'files/'.$this->Session->read('Auth.User.id').'/'.$this-
>Post->id;
                $this->Post->saveField('dirname', $dirname);

                // transfert

        } else {
                // Error
        }

}

The simplest would be to let Media plugin transfert in Media folder,
the path would be store in DB with dirname and basename.


On 14 sep, 12:43, Zaky Katalan-Ezra <procsh...@gmail.com> wrote:
> Thank you
>
> Media plugin some how bind to the save function.
> So How do I tell the media plugin not to run after save and run only when I
> have the post_id?
>
>
>
>
>
>
>
>
>
> On Wed, Sep 14, 2011 at 11:47 AM, BenJsno <bench...@yahoo.fr> wrote:
> > You have to save your post before upload the file.
> > in your Post_controller :
>
> >        function add() {
> >                [...]
> >                if (!empty($this->data)) {
>
> >                        $this->Post->create();
> >                        if ($this->Post->save($this->data)) {
> >                                [...]
> >                                $new_id = $this->Post->id
> >                                // you can maybe put this data temporarily
> > in the session
> >                                $this->Session->write('Post.last_id',
> > $this->Post->id);
> >                        } else {
> >                                [...]
> >                        }
> >                }
>
> >                [...]
> >        }
>
> > Hope this helps you
>
> > On 13 sep, 13:24, ZAky <procsh...@gmail.com> wrote:
> > > I save my posts files under /files/[user_id]/[post_id]/[image].
> > > This mean I need to know the just seved post id in Post->transfer_to.
> > > How do I achieve that?
>
> > > Thank you
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php
>
> --
> Regards,
> Zaky Katalan-Ezra
> QA Administratorwww.IGeneriX.com
> Sites.IGeneriX.com
> 054-7762312

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to