title: CodeIgniter upload png image type not working?
body: <p>what my problem is why my code unable to store .png file in database and uploads folder, but other than file like .jpg, .gif I successfully insert to database and uploads folder, I had include <code>$config['allowed_types'] = 'png'</code> as well, in addition, here is what I var_dump out the error message "The filetype you are attempting to upload is not allowed." , Any idea how to solve my problem?</p>
  
  <p>here is my code:</p>
  
  <pre><code>$upload_file_name = '';
  
  $config['upload_path'] = '/var/www/html/uploads/';
  $config['allowed_types'] = 'jpg|gif|png';
  $config['max_size'] = 100000;
  $config['overwrite'] = TRUE;
  $this-&gt;load-&gt;library('upload', $config);
  if(!$this-&gt;upload-&gt;do_upload('receipt_attachment'))
  {
      $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
      $errormessage = $this-&gt;upload-&gt;display_errors();
      $this-&gt;session-&gt;set_flashdata('error', $errormessage);
      redirect('home/add_product');
  }else{
      $upload_data = $this-&gt;upload-&gt;data();
      $upload_file_name = $upload_data['file_name'];
  }
  </code></pre>
  
  <p>thanks</p>