Skip to content

Instantly share code, notes, and snippets.

@mariuswilms
Created May 30, 2009 06:19
Show Gist options
  • Select an option

  • Save mariuswilms/120408 to your computer and use it in GitHub Desktop.

Select an option

Save mariuswilms/120408 to your computer and use it in GitHub Desktop.
<?php
class MoviesController extends AppController {
function edit($id = null) {
/* For a single upload */
$this->data = array(
'Movie' => array(
'file' => 'transferable item here'
));
$this->Movie->save($this->data);
/* For multiple uploads */
$this->data = array(
'Movie' => array(
0 => array('file' => 'transferable item here'),
1 => array('file' => 'transferable item here')
));
$this->Movie->saveAll($this->data, array('validate' => 'first'));
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment