title: Module Prestashop 1.7 : Custom image upload always replaced
body: <p>My file_url field is always erased in Database if I don't select it. (even if an image is already integrated)</p>
  
  <p><a href="https://i.stack.imgur.com/DzCdN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DzCdN.png" alt="enter image description here"></a></p>
  
  <p><em>If I click Save in this situation, the field PC Image is deleted.</em></p>
  
  <p>Here is my <code>postImage()</code> method in my <code>AdminCustomController</code></p>
  
  <pre><code> protected function postImage($id)
      {
  
  
          $file = isset($_FILES['file_url']) ? $_FILES['file_url'] : false;
  
  
  
          if ($file &amp;&amp; is_uploaded_file($file['tmp_name'])) {
  
  
              $path = _PS_MODULE_DIR_ . 'custom/img/';
              $tmp_arr = explode('.', $file['name']);
              $filename = $file['name'];
  
  
  
              if (!Tools::copy($file['tmp_name'], $path . $filename)) {
                  $errors[] = Tools::displayError('Failed to load image');
              }
  
          }
  }
  </code></pre>
  
  <p>And here is the renderForm()</p>
  
  <pre><code>public function renderForm()
      {
        $image_url = '';
  
         if($this-&gt;object-&gt;file_url) {
              $image_url = ImageManager::thumbnail(
                  _PS_MODULE_DIR_ . 'homecase/img/' . $this-&gt;object-&gt;file_url,
                  $this-&gt;table . $this-&gt;object-&gt;file_url,
                  150,
                  'jpg',
                  true,
                  true
              );
          }
          $this-&gt;fields_form = [
              //Entête
              'legend' =&gt; [
                  'title' =&gt; $this-&gt;module-&gt;l('Edition'),
                  'icon' =&gt; 'icon-cog'
              ],
  
                  array(
                      'type' =&gt; 'file',
                      'label' =&gt; $this-&gt;l('PC Image'),
                      'name' =&gt; 'file_url',
                      'display_image' =&gt; true,
                      'image' =&gt; $image_url ? $image_url : false,
                  ),
  
  ....
  </code></pre>
  
  <p>The upload and the save in DB is OK. But when the image exists and I don't select an other in the field. The <code>file_url</code> field is erased in the DB.</p>
  
  <p>Could you help me?</p>
  
  <p>Thanks !</p>