title: How to add a custom image field to a category in Magento?
body: <p>I'm a newbie with magento. I want to add two custom image fields to a category. I have created a module with installer file to my module:</p>
  
  <pre><code>$installer = $this;
  $installer-&gt;startSetup();
  
  $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
  $entityTypeId     = $setup-&gt;getEntityTypeId('catalog_category');
  $attributeSetId   = $setup-&gt;getDefaultAttributeSetId($entityTypeId);
  $attributeGroupId = $setup-&gt;getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
  
  $setup-&gt;addAttribute('catalog_category', 'image1', array(
      'input'         =&gt; 'image',
      'type'          =&gt; 'file',
      'group' =&gt; 'General',
      'label'         =&gt; 'Additional image 1',
      'visible'       =&gt; 1,
      'required'      =&gt; 0,
      'user_defined' =&gt; 1,
      'frontend_input' =&gt;'',
      'global'        =&gt; Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
      'visible_on_front'  =&gt; 1,
  ));
  
  $setup-&gt;addAttributeToGroup(
   $entityTypeId,
   $attributeSetId,
   $attributeGroupId,
   'image1',
   '999'  //sort_order
  );
  
  $installer-&gt;endSetup();
  </code></pre>
  
  <p>I can see the image field when editing or adding new category but its not saving to database. How to make it work? Thanks</p>