Centurion can perform multiupload out of the box using some flash+javascript trickery. There has been some work[1] on an HTML5 multiuploader but this is not reasonably usable for websites targetting all browsers.
Anyway, in my project, this is how it's done:
class Mymodule_Model_DbTable_Post extends Centurion_Db_Table_Abstract
{
// [....]
protected $_manyDependentTables = array(
'gallery' => array(
'refTableClass' => 'Media_Model_DbTable_File',
'intersectionTable' => 'Mymodule_Model_DbTable_PostGallery',
'reflocal' => 'post',
'refforeign' => 'media'
));
// [...]
}
as you can see I also have a Momodule_Model_DbTable_PostGallery class which basically is a table listing {post_id, media_id} tuples.
* in my form class, i can add some options about the uploadable content
class Mymodule_Form_Model_Post extends Centurion_Form_Model_Abstract
{
// [...]
public function __construct($options = array())
{
// Default block
$this->_elementLabels = array(
// [...]
'gallery' => $this->_translate('Gallery')
);
parent::__construct($options);
}
public function init()
{
parent::init();
// Gallery
$gallery = $this->getElement('gallery');
$gallery->getFile()->addExtension('jpg,jpeg,png,gif'); // setting allowed extensions
$gallery->setLabel('Gallery'); // setting label
$gallery->getFile()->getFilename()->getValidator('Size')->setMax(70*1024*1024); // setting max file size
}
}