I want to replace/overwrite my image upload, which works. But the file have copied end up with another extension.
This is my controller
function add(){
if (isset($_POST['submit'])) {
$id = $this->input->post('nisn', TRUE);
$config['upload_path'] = './upload/';
$config['allowed_types'] = 'jpg|jpeg|png';
$config['max_size'] = 1024;
$config['file_name'] = $id;
$config['overwrite'] = TRUE;
$this->load->library('upload', $
$this->upload->do_upload('userfile');
$upload = $this->upload->data();
print_r($upload);
die;
}