Adding a File Upload Field to the Magento System.xml Configuration

<upload_file translate=”label tooltip comment”>
<label>Upload File</label>
<comment>Add comments here</comment>
<tooltip>Add a tooltip that appears on hover</tooltip>
<upload_dir config=”system/filesystem/media” scope_info=”1″>admin-config-uploads</upload_dir>
<base_url type=”media” scope_info=”1″>admin-config-uploads</base_url>

sets the upload location for the file. In the above example, the file will be saved in a sub-folder under the media folder. e.g. /media/admin-config-uploads/. To get the full URL / link to the file from the above example, you can use the following code:

echo Mage::getBaseUrl(‘media’) . Mage::getStoreConfig(‘system_config_name/group/upload_file’);

Be sure that the media folder has write permission and you replace system_config_name and group with your actual variables.