title: Set Max Size in CodeIgniter File Upload
body: <p>I've used this private function to file upload in CodeIgniter Project. I've never set max_size in this function. Here, how to set max_size in this private function?</p>
  
  <pre><code>private function do_upload($value){
      $type = explode('.', $_FILES[$value]["name"]);
      $type = $type[count($type)-1];
      $url = "./assets/uploads/products/".uniqid(rand()).'.'.$type;
  
      if(in_array($type, array("jpg","jpeg","gif","png")))
  
      if(is_uploaded_file($_FILES[$value]["tmp_name"]))
  
      if(move_uploaded_file($_FILES[$value]["tmp_name"], $url))
  
      return $url;
  
      return "";
  }
  </code></pre>