I'm not sure id $student is an integer ID or an entire array. You seem
to be treating it as both. You really only need to pass the ID.

In your form (the one with the file upload) include something like this:

$form->hidden('Student.id', array('value' => $student['Student']['id']))

That variable syntax might ... vary. I don't know precisely what you
have going on.

Next, in the add() method, grab the ID from the data passed by the form:

$student_id = $this->data['Student']['id'];



On Tue, Apr 22, 2008 at 2:07 AM, damo <[EMAIL PROTECTED]> wrote:
>
>  thanks b logica, it still doesn't seem to work.
>
>  Let me just clarify what I am trying to do.
>  From the view of the individual student, which uses the $student
>  variable, I try to add a file.  So the $student is passed to the
>  function so that we know which student the file relates to.  So in my
>  table that stores my file, there is a field called 'student', so when
>  I want to view all the files relating to that student, I just do a
>  search for his student number.  So all I want to do is set the field
>  of the file table to the $student variable past to the function.
>  Without that line in there, it uploads the file fine, but I don't know
>  which student the file relates to.  I hope that makes sense....
>
>  I tried that syntax for the flash message that you outlined (and
>  taking out the set), but it just goes to /myfiles/view without the
>  variable at the end...
>
>  thanks for your help, I feel it is very close...
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to