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 <[email protected]> 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 site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php