and one other....

I've got the upload controller working well, except where I try to do
something myself....
        function add($student = null) {
        if (!empty($this->data) &&
             is_uploaded_file($this->data['Myfile']['File']
['tmp_name'])) {
            $fileData = fread(fopen($this->data['Myfile']['File']
['tmp_name'], "r"),
                                     $this->data['Myfile']['File']
['size']);

            $this->data['Myfile']['name'] = $this->data['Myfile']
['File']['name'];
            $this->data['Myfile']['type'] = $this->data['Myfile']
['File']['type'];
            $this->data['Myfile']['size'] = $this->data['Myfile']
['File']['size'];
            $this->data['Myfile']['data'] = $fileData;
            $this->data['Myfile']['student'] = $student;  **** this line I've
added stops it saving

            $this->Myfile->save($this->data);

            $this->flash('The file has been uploaded.','/students/
main', $pause='2');
        }
    }

probably just another easy syntax thing....
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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