Hi,

I am creating a form with a file upload function, the form was working fine 
(adding text based information) before i added the file upload function, now 
the file upload function is working fine (uploading the file and adding the URL 
to the DB) and the form is adding the User ID but the rest of the form data is 
not working, i am getting no errors.

Here is my add function from the controller...

function add() {
       if (!empty($this->data)) {
           $fileOK = $this->uploadFiles('img/files', $this->data['File']);
           $this->data['Course']['image_url'] = $fileOK['urls'][0];
           $this->data['Course']['user_id'] = 
$this->Session->read('Auth.User.id');
           if ($this->Course->save($this->data)) {
               $this->Session->setFlash(__('Course saved.', true));
               $this->redirect(array('action'=>'index'));
           } else {
               $this->Session->setFlash(__('The course could not be saved 
Please try again.', true));
           }
       }
       $members = $this->Course->Member->find('list');
       $outfits = $this->Course->Outfit->find('list');
       $types = $this->Course->Type->find('list');
       $ratings = $this->Course->Rating->find('list');
       $comments = $this->Course->Comment->find('list');
       $deals = $this->Course->Deal->find('list');
       $facilities = $this->Course->Facility->find('list');
       $this->set(compact('members', 'outfits', 'types', 'ratings', 'comments', 
'deals', 'facilities'));
   }

I am fairly new to Cake and my first guess would be that i am implicitly telling it to add the file and the 
user ID but not the rest of the fields, but on saying that it was all working fine before i added 
"$fileOK = $this->uploadFiles('img/files', $this->data['File']);" and 
"$this->data['Course']['image_url'] = $fileOK['urls'][0];"

Help!



--
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

Reply via email to