title: magento 1.9 Edit form is not displaying thumbnail image
body: <p>I am trying to display thumbnail image on EDIT form in Admin custom module.
  I am getting check box  to delete image.
  I am getting a square box where image supposed to display.
  But it's not displaying image.</p>
  
  <p>Please suggest me solution</p>
  
  <p>my save() action in controller is</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public function saveAction()
      {
          if ($data = $this-&gt;getRequest()-&gt;getPost())
          {
      if(isset($_FILES['shop_image']['name']) &amp;&amp; $_FILES['shop_image']['name'] != '') 
      { 
       try {   
         /* Starting upload */   
         $uploader = new Varien_File_Uploader('shop_image');
    
         // Any extention would work
         $uploader-&gt;setAllowedExtensions(array('jpg','jpeg','gif','png'));
         $uploader-&gt;setAllowRenameFiles(false);
    
         
         $uploader-&gt;setFilesDispersion(false);
         
         echo $path = Mage::getBaseDir('media').DS.'ud'.DS;
         
         
         
         $uploader-&gt;save($path, $_FILES['shop_image']['name'] );
    
        } catch (Exception $e) {
    
        }
          //  echo $path;exit;
        //this way the name is saved in DB
  
                 $data['shop_image'] = $path.$_FILES['shop_image']['name'];
            }
      else if((isset($data['shop_image']['delete']) &amp;&amp; $data['shop_image']['delete'] == 1)){
         .'ud'.DS.$data['shop_image']['value'];
        unlink($data['shop_image']['value']);
        //set path to null and save to database
        $data['shop_image'] = '';
       
        
      }
      $model = Mage::getModel('shop/shop');
              $id = $this-&gt;getRequest()-&gt;getParam('id');
              if ($id) {
                  $model-&gt;load($id);
              }
              $model-&gt;setData($data);
   
      Mage::getSingleton('adminhtml/session')-&gt;setFormData($data);
       
              try {
                  if ($id) {
                      $model-&gt;setId($id);
                  }
                  $model-&gt;save();
   
                  if (!$model-&gt;getId()) {
                      Mage::throwException(Mage::helper('shop')-&gt;__('Error saving shop'));
                  }
   
                  Mage::getSingleton('adminhtml/session')-&gt;addSuccess(Mage::helper('shop')-&gt;__('Shop was successfully saved.'));
                  Mage::getSingleton('adminhtml/session')-&gt;setFormData(false);
   
                  // The following line decides if it is a "save" or "save and continue"
                  if ($this-&gt;getRequest()-&gt;getParam('back')) {
                      $this-&gt;_redirect('*/*/edit', array('id' =&gt; $model-&gt;getId()));
                  } else {
                      $this-&gt;_redirect('*/*/');
                  }
   
              } catch (Exception $e) {
                  Mage::getSingleton('adminhtml/session')-&gt;addError($e-&gt;getMessage());
                  if ($model &amp;&amp; $model-&gt;getId()) {
                      $this-&gt;_redirect('*/*/edit', array('id' =&gt; $model-&gt;getId()));
                  } else {
                      $this-&gt;_redirect('*/*/');
                  }
              }
   
              return;
    
             
          }
          Mage::getSingleton('adminhtml/session')-&gt;addError(Mage::helper('shop')-&gt;__('No data found to save'));
          $this-&gt;_redirect('*/*/');
      }</code></pre>
  </div>
  </div>
  </p>
  
  <p>my form.php is</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?php
   
  class Sample_Shop_Block_Adminhtml_Shop_Edit_Form extends Mage_Adminhtml_Block_Widget_Form
  {
      protected function _prepareForm()
      {
          if (Mage::getSingleton('adminhtml/session')-&gt;getExampleData())
          {
              $data = Mage::getSingleton('adminhtml/session')-&gt;getExamplelData();
              Mage::getSingleton('adminhtml/session')-&gt;getExampleData(null);
          }
          elseif (Mage::registry('example_data'))
          {
              $data = Mage::registry('example_data')-&gt;getData();
          }
          else
          {
              $data = array();
          }
   
          $form = new Varien_Data_Form(array(
                  'id' =&gt; 'edit_form',
                  'action' =&gt; $this-&gt;getUrl('*/*/save', array('id' =&gt; $this-&gt;getRequest()-&gt;getParam('id'))),
                  'method' =&gt; 'post',
                  'enctype' =&gt; 'multipart/form-data',
          ));
   
          $form-&gt;setUseContainer(true);
   
          $this-&gt;setForm($form);
   
          $fieldset = $form-&gt;addFieldset('example_form', array(
               'legend' =&gt;Mage::helper('shop')-&gt;__('Shop Information')
          ));
   
          $fieldset-&gt;addField('shopname', 'text', array(
               'label'     =&gt; Mage::helper('shop')-&gt;__('Shop Name'),
               'class'     =&gt; 'required-entry',
               'required'  =&gt; true,
               'name'      =&gt; 'shopname',
               'note'     =&gt; Mage::helper('shop')-&gt;__('The name of the shop.'),
          ));
   
          $fieldset-&gt;addField('logo', 'text', array(
               'label'     =&gt; Mage::helper('shop')-&gt;__('Logo'),
               'class'     =&gt; 'required-entry',
               'required'  =&gt; true,
               'name'      =&gt; 'logo',
          ));
   
          $fieldset-&gt;addField('productimage', 'text', array(
               'label'     =&gt; Mage::helper('shop')-&gt;__('Product Image'),
               'class'     =&gt; 'required-entry',
               'required'  =&gt; true,
               'name'      =&gt; 'productimage',
          ));
    
    $fieldset-&gt;addField('state', 'text', array(
               'label'     =&gt; Mage::helper('shop')-&gt;__('State'),
               'class'     =&gt; 'required-entry',
               'required'  =&gt; true,
               'name'      =&gt; 'state',
          ));
    
    $fieldset-&gt;addField('shop_image','image', array(
    'label' =&gt; Mage::helper('shop')-&gt;__('Shop Image'),
    'required' =&gt; false,
    'name' =&gt; 'shop_image', 
    ));
    
     
  
  
          $form-&gt;setValues($data);
   
          return parent::_prepareForm();
      }
  }</code></pre>
  </div>
  </div>
  </p>