php - Form validation codeigniter not work and how to upload picture?

one text

Solution:

You should print errors while on development. It usualy tells you what's wrong. Ex:

if ($this->upload->do_upload('bukti_img')) {
   return $this->upload->data("file_name");
} else {
   print_r($this->upload->display_errors());
   exit;
}

if ($this->form_validation->run()) {
   $this->M_checkout->bukti_to_db();
   redirect('thank', 'refresh');
} else {
   print_r(validation_errors());
   exit;
}

Though i'm pretty sure you can't validate <input class=" file-input" type="file" name="bukti_img"> with form_validation like that. Since you are validating $_POST while your file is inside the $_FILES variable. Do the file validation on the file upload function.

Source