public function aksi_upload(){
$config['upload_path'] = './gambar/'; <!-- Lokasi foto -->
$config['allowed_types'] = 'gif|jpg|png'; <!-- Type file -->
$config['max_size'] = 100; <!-- maksimal ukuran gambar -->
$config['max_width'] = 1024; <!-- maksimal lebar -->
$config['max_height'] = 768; <!-- maksimal tinggi -->
$this->load->library('upload', $config); <!-- untuk memanggil library upload pada CodeIgniter dengan menggunakan pengaturan yang sudah di buat dari variabel $config -->
if ( ! $this->upload->do_upload('berkas')){
$error = array('error' => $this->upload->display_errors());
$this->load->view('v_upload', $error);
}else{
$data = array('upload_data' => $this->upload->data());
$this->load->view('v_upload_sukses', $data);
}
}