For system=>configuration:
In your system.xml you can add Form-Elements. There are 3 relevant nodes:
- frontend_type - corresponding to /lib/Varien/Data/Form/Element
- source_model
- backend_model
I know that you can build your own source- and so I believe backend_model. It is relative easy to do it. Just add the classpath to your nodevalue like "adminhtml/system_config_source_yesno".
If you have a look to /lib/Varien/Data/Form/Element, you can see File.php which you can use to build the Upload-Frontendtype.
For other admin-sections:
You can use extend Mage_Adminhtml_Block_Widget_Form and Hmx_Incopay_Block_Widget_Container
In your widget form you can add the following in the constructor:
$form = new Varien_Data_Form(array(
'id' => 'edit_form',
'action' => $this->getUrl('*/*/edit', array(
'id' => $this->getRequest()->getParam('id')
)),
'method' => 'post',
'enctype' => 'multipart/form-data'
)
);
and
$fieldset->addField(Mage::getStoreConfig('XXXX/input_file_name'), 'file', array(
'name' => Mage::getStoreConfig('XXXX/input_file_name'),
'label' => __('CSV account data'),
'class' => 'required-entry',
'required' => true,
));
Dont change the form-id and beware of some other conventions listed here http://blog.kervinramen.com/2012/10/how-magento-widget-form-container.html