gagal Upload Foto dengan CI

kira2 ada yang salah ga ya gan dengan codingan saya? mohon di cek VIEW

 <form action="<?php echo base_url().'index.php/c_login/aksiupload'?>" method="post" enctype="multipart/form-data">
	<table>
		<input type="file" name="uploadgambar">
		<input type="submit">
	</table>
</form>

Controller

 public function aksiupload(){
		$foto=$_FILES['uploadgambar']['name'];

		$config['upload_path']='./uploads/images';
		$config['allowed_types']='.jpg|jpeg|png|gif';
		$config['max_size']='10000';
		$config['width_size']='5000';
		$config['height_size']='5000';

		$this->upload->initialize($config);
		if(! $this->upload->do_upload('uploadgambar')){
			echo "Upload Gagal";
		}else{
			$data=array(
				'foto'=>$foto
				);
			$this->m_login->masukgambar('uploadfoto',$data);
			redirect('c_cekstatus');
		}

	}

MODEL

 public function masukgambar($table,$where)
	{
		return $this->db->insert($table,$data);
	}
avatar IqbalHanafi20
@IqbalHanafi20

39 Kontribusi 2 Poin

Dipost 7 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban