that's what I figured it would be, but it doesn't seem to work, just
takes me to the page without the variable at the end. Here is whole
function. I'm also having a problem with one of the lines of code
(highlighted below), as it stops it from saving the file all together
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->set['Myfile']['student'] = $student; ***** this line
stops it from saving, works fine without
$this->Myfile->save($this->data);
$this->flash('The file has been uploaded.', '/myfiles/
view/'.$student,2);
}
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---