title: How to encrypt image name and save into database?
body: <p>I can save the image name into database without any problem but when I try to encrypt the name only the image path gets the encrypted name but the database not</p>
  
  <pre><code>public function fileUpload(){
  
      $clientes = $this-&gt;pm-&gt;getAllProducts();
  
      foreach ($clientes as $cliente) {
  
          $teste = $cliente-&gt;id;
      }
  
      if(!empty($_FILES['file']['name'])){
  
          // Set preference
          $config['upload_path'] = "uploads/";    
          $config['allowed_types'] = 'jpg|jpeg|png|gif';
          $config['max_size']    = '5024'; // max_size in kb
          $config['encrypt_name'] = TRUE;
          $config['file_name'] =  $_FILES['file']['name'];
  
          $this-&gt;upload-&gt;initialize($config);
  
          //Load upload library
          $this-&gt;load-&gt;library('upload',$config);     
  
          $data = array(
              'pub_id' =&gt; $teste,
              'url' =&gt; $_FILES['file']['name']
          );
  
          $this-&gt;pm-&gt;addProduct($data);   
  
          // File upload
          if($this-&gt;upload-&gt;do_upload('file')){
              // Get data about the file
              $uploadData = $this-&gt;upload-&gt;data();
          }
      }
  
  }
  </code></pre>