This is a simple example of Multiple File Upload
To achieve similar through Magento's Form Library, we will modify its code a bit in this way
Modify getElementHtml
method of lib/Varien/Data/Form/Element/Abstract.php
public function getElementHtml()
{
if($this->getType()=='file' && $this->getMultiple())
$_multiple = ' multiple';
$html = '<input id="'.$this->getHtmlId().'" name="'.$this->getName()
.'" value="'.$this->getEscapedValue().'" '.$this->serialize($this->getHtmlAttributes()).$_multiple.'/>'."\n";
$html.= $this->getAfterElementHtml();
return $html;
}
and then just pass new attribute multiple=>true
in you field declaration like this
$fieldset->addField('uploadpdf', 'file', array(
'label' => Mage::helper('promotionsoffers')->__('Upload PDF'),
'name' => 'uploadpdf[]',
'multiple'=>true
));