It's been a while since I want a way to add file upload system when creating a payment method.

In a custom module , I created a new method of payment. When declaring my fields in the file "system.xml" I'll wish to add an input to upload a PDF. Here is part of my code :

<bvr translate="label" module="paygate">
      <bvrfile translate="label">
         <label>BVR file</label>

Here is a screenshot of my admin panel: enter image description here

Do you know if it is possible to add this type of field and how I can retrieve the file's URL upload?


File will be saved in the media folder.

you have to specify the file path in system.xml by following code

<upload_dir config="system/filesystem/media/" scope_info="1">admin-config-uploads</upload_dir>

here the file will be save in the root/media/<store_code>/admin-config-uploads/

so to get the file path use the following code

    echo Mage::getBaseUrl('media') . 'admin-config-uploads'.Mage::getStoreConfig('system_config_name/group/upload_file');

Refer this link

| improve this answer | |
  • Thanks a lot, it works like an hot cake !! ;) I'm not able to change the destination folder like you describe. but it does not matter. thanks a lot for your reply & your help – Flow Jun 26 '15 at 8:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.