title: CodeIgniter - How to show error message from do_upload
body: <p>i want to show the success message of a content insert on a redirect link.here is my code of controller:-</p>
  
  <pre><code>public function do_upload($field) {
          $config['upload_path'] = './uploads/';
          $config['allowed_types'] = 'gif|jpg|png';
          $config['max_size'] = '100000';
          $config['max_width'] = '3000';
          $config['max_height'] = '3000';
  
          $this-&gt;load-&gt;library('upload', $config);
  
          if (!$this-&gt;upload-&gt;do_upload($field)) {
              $error = array('error' =&gt; $this-&gt;upload-&gt;display_errors());
  
              return $error;
          } else {
  
              $updata =$this-&gt;upload-&gt;data();
              $data = $updata['raw_name'].$updata['file_ext'];
              return $data;
          }
  
  
       }
  
  
  public function index() {
  
   $this-&gt;load-&gt;model('blog');
  
          if(isset($_POST['post']) &amp;&amp; (!empty($_POST['post']) || strlen($_FILES['inputUpProfile']['name']) &gt; 0) ){
          if(strlen($_FILES['inputUpProfile']['name']) &gt; 0) 
          {
          $pic = $this-&gt;do_upload('inputUpProfile');
          print_r($pic);
          if ($this-&gt;input-&gt;post('post') == ''){$type="image";} else {$type="image-with-text";}
          }
  
          else {$pic = ""; $type = "text"; }
  
              $result = $this-&gt;blog-&gt;addPost($_SESSION['user_id'], $type  , $this-&gt;input-&gt;post('post'),$pic);
          }
  $this-&gt;template-&gt;build('home_view',$this-&gt;data);
  }
  </code></pre>
  
  <p>when upload image big than 3000 its was show me this message</p>
  
  <pre><code>Array ( [error] =&gt;
  
  The filetype you are attempting to upload is not allowed.
  ) 
  </code></pre>
  
  <p>how can i read this error in my view ??</p>
  
  <p>================================================</p>
  
  <p>Update :-</p>
  
  <p>the error messagelike this:-</p>
  
  <pre><code>Array ( [error] =&gt;
  
  The filetype you are attempting to upload is not allowed.
  )
  A PHP Error was encountered
  
  Severity: Notice
  
  Message: Array to string conversion
  
  Filename: mysql/mysql_driver.php
  
  Line Number: 552
  A PHP Error was encountered
  
  Severity: Warning
  
  Message: Cannot modify header information - headers already sent by (output started at E:\AppServ\www\cc\ccc\application\controllers\home.php:83)
  
  Filename: core/Common.php
  
  Line Number: 442
  A Database Error Occurred
  
  Error Number: 1054
  
  Unknown column 'Array' in 'field list'
  
  INSERT INTO `events` (`ev_user_id`, `ev_type`, `ev_text`, `ev_pic`, `ev_date`) VALUES (445, 'image', '', Array, '2013-10-03 23:51:47')
  
  Filename: E:\AppServ\www\cc\ccc\system\database\DB_driver.php
  
  Line Number: 330
  </code></pre>