Postingan lainnya
The upload destination folder does not appear to be writable.
dimana yang salah gan? persaan bener aja dah
public function proses_edit()
{
$email = $this->input->post('email');
$name = $this->input->post('name');
$uploadImg = $_FILES['image']['name'];
if ($uploadImg) {
$config['allowed_types'] = 'jpg|gif|png';
$config['max_size'] = 2048;
$config['max_width'] = 2048;
$config['max_height'] = 2048;
$config['upload_path'] = './assets/img/profile/';
$this->load->library('upload', $config);
if ($this->upload->do_upload('image')) {
$newImg = $this->upload->data('file_name');
$this->db->set('image', $newImg);
} else {
$this->session->set_flashdata('message', '<div class="alert alert-danger" role="alert">' . $this->upload->display_errors() . '</div>');
}
}
$this->db->set('name', $name);
$this->db->where('email', $email);
$this->db->update('user');
$this->session->set_flashdata('message', '<div class="alert alert-success" role="alert">Congrats bout your new profile yo!</div>');
redirect('home');
}
0