title: how can i upload a video and it saved to a folder in codeigniter?
body: <p>i'm new to codeigniter. i need help to upload a picture and video and save it to folder and database.</p>
  
  <p><strong>here is my controller</strong></p>
  
  <pre><code>public function upload()
  {   
      $this-&gt;m_upload-&gt;upload();  
      $this-&gt;upload_gambar(); 
  }
  
  public function upload_gambar()
  {
      //load the helper
      $this-&gt;load-&gt;helper('form');
      $config['upload_path'] = 'assets/gallery/images';
  
      $config['allowed_types'] = 'gif|jpg|png|mp4';
      $config['max_size'] = '';
  
      $this-&gt;load-&gt;library('upload', $config);    
      $this-&gt;upload-&gt;initialize($config);
      $this-&gt;upload-&gt;set_allowed_types('*');
      $data['upload_data'] = '';
      $this-&gt;upload-&gt;do_upload('uploadan');
  
      redirect(c_upload);
  }
  </code></pre>
  
  <p><strong>and this is my models</strong></p>
  
  <pre><code>public function upload()
  {
      $title = $this-&gt;input-&gt;post('title');
      $details = $this-&gt;input-&gt;post('details');
      $type = $this-&gt;input-&gt;post('gallery');
      $picture = $_FILES['uploadan']['name'];
  
      $data = array(
          'url' =&gt; $picture,
          'title' =&gt; $title,
          'details' =&gt; $details,
          'category' =&gt; $type
      );
  
      $this-&gt;db-&gt;insert('gallery', $data);
  }
  </code></pre>
  
  <p>i've already set upload_max_filesize and post_max_size in the php.ini but it still not working. please help me fix this problem. thankyou</p>