I can't really wrap my head around this one. I have Entries and
Screenshots. From my Entries - Add view I want to add an entry (no
problem) and add a Screenshot (problem).

---------My view contains this:

<p>Title:
<?php echo $html->input('Entry/title')?></p>

....etc...

<p>Screenshot (optional):
<?php echo $html->file('Screenshot/file')?></p>

---------My Entries_controller contains this:

function add() {
        if (!empty($this->data['Entry'])) {
                if($this->Entry->save($this->data['Entry'])) {
                        $this->flash('Your entry has been added.','/entries/');
                }
        }
}

How do I get my 'file' to my Screenshots_controller to put it where it
needs to go and add it to the screenshots database? My Entry model has
a hasMany relation with Sreenshot and my Screenshot model has a
belongsTo Entry relation.

Regularly I would use $this->Entry->Screenshot->save($this->data); but
since this is an image, things need to happen before I can get the
data to put in the database.

Any pointers would be great, I'm rather lost....and an amateur
programmer in case you wondered.

(I've tried incorporating Chris Partridge's File Handler Component,
but set to db it keeps complaining that the Screenshot class is
missing.)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to